IsNumeric()IsDate()...... [英] IsNumeric() IsDate() ...

查看:76
本文介绍了IsNumeric()IsDate()......的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




.net框架中有哪些替换方法用于旧的vb

函数,如IsNumeric(),IsDate(),等等...


谢谢

- 迈克尔

Hi,

What are the replacement methods in the .net framework for the old vb
functions such as IsNumeric(), IsDate(), etc...

Thanks
--Michael

推荐答案

那些方法实际上仍然存在于
Microsoft.VisualBasic.Compatibility中。他们害怕把它们拿出去,而且b $ b吓坏了所有的VB6开发者。默认情况下VB.NET项目引用这个,

所以这些方法都可用。


除此之外,你可以使用Int32.Parse,Double.Parse, DateTime.Parse等

检查某些东西是否适合这些数据类型的方法。如果您要解析的内容无法转换为

特定数据类型,则会抛出

异常。


Michael Ramey < raterus @本地>在留言中写道

新闻:%2 **************** @ TK2MSFTNGP09.phx.gbl ...
Those methods are actually still there in
Microsoft.VisualBasic.Compatibility. They were afraid to take them out and
freak out all the VB6 developers. By default VB.NET projects reference this,
so these methods are available.

Other then that, you can use Int32.Parse,Double.Parse,DateTime.Parse, etc
method to check if something fits those data types. There will be an
exception thrown if whatever you are parsing can''t be turned into that
particular datatype.

"Michael Ramey" <raterus@localhost> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...


.net框架中有哪些替换方法用于旧的vb
函数,如IsNumeric(),IsDate()等...

谢谢
- 迈克尔
Hi,

What are the replacement methods in the .net framework for the old vb
functions such as IsNumeric(), IsDate(), etc...

Thanks
--Michael



>

.net框架中有哪些替换方法用于旧的vb
函数,如IsNumeric(),IsDate()等...

谢谢
- 迈克尔

What are the replacement methods in the .net framework for the old vb
functions such as IsNumeric(), IsDate(), etc...

Thanks
--Michael




你可能会看看Int32.Parse()和朋友以及DateTime.Parse()和< br $> b $ b朋友。


ChrisG



You might look at Int32.Parse() and friends as well as DateTime.Parse() and
friends.

ChrisG


*" Michael Ramey" < raterus @本地> scripsit:
* "Michael Ramey" <raterus@localhost> scripsit:
.net框架中有哪些替换方法用于旧的vb
函数,如IsNumeric(),IsDate()等...
What are the replacement methods in the .net framework for the old vb
functions such as IsNumeric(), IsDate(), etc...



没有替代品。这些功能不会被替换。

它们是VB.NET的有效部分,没有理由不再使用



对于''IsNumeric'',你现在可以使用''Double.TryParse'',虽然

不是1:1的替代品。在.NET 2.0(Whidbey,2004)中,对于其他数值数据类型(如整数)也会有

''TryParse''方法。对于

''IsDate''你可以使用''DateTime.Parse''和/或''DateTime.ParseExact''+一个

异常处理程序(''尝试......抓住'')。


-

Herfried K. Wagner [MVP]

< http:/ /www.mvps.org/dotnet>



There are no "replacements". These functions don''t get "replaced".
They are valid part of VB.NET and there is no reason why they should not
be used any more.

For ''IsNumeric'', you can use ''Double.TryParse'' at the moment, although
thats not an 1:1 replacement. In .NET 2.0 (Whidbey, 2004) there will be
''TryParse'' methods for other numeric datatypes like ''Integer'' too. For
''IsDate'' you can use ''DateTime.Parse'' and/or ''DateTime.ParseExact'' + an
exception handler (''Try...Catch'').

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>


这篇关于IsNumeric()IsDate()......的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆