当前位置:编程学习 > C#/ASP.NET >>

dateTimePicker的错误



错在哪里呢?

正确的写法是什么呢?谢谢 --------------------编程问答-------------------- BufferVarValue变量字符串不能转成日期型

好比
BufferVarValue="hello";
你说BufferVarValue能转日期类型吗?
--------------------编程问答-------------------- 要格式化的字符串有问题  不是日期之类的形式 --------------------编程问答-------------------- 那该如何解决呢? --------------------编程问答--------------------
引用 1 楼 gxingmin 的回复:
BufferVarValue变量字符串不能转成日期型

好比
BufferVarValue="hello";
你说BufferVarValue能转日期类型吗?


BufferVarValue的定义是:

StringBuilder BufferVarValue = new StringBuilder(100);
--------------------编程问答--------------------
引用 4 楼 zhenghq1001 的回复:
引用 1 楼 gxingmin 的回复:BufferVarValue变量字符串不能转成日期型

好比
BufferVarValue="hello";
你说BufferVarValue能转日期类型吗?

BufferVarValue的定义是:

C# code?1StringBuilder BufferVarValue = new StringBuilder……

关键是看里面是什么字符串 --------------------编程问答-------------------- the SDK's support email me : modify the returned date format (修改返回的日期格式)

但是,如何修改返回值的格式呢?谢谢

--------------------编程问答-------------------- 楼主可以先判断是否能正确转换为日期格式
if(DateTime.TryParse(BufferVarValue.ToString()))
    DateTimePicker1.Value = DateTime.Parse(BufferVarValue.ToString());

补充:.NET技术 ,  C#
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,