正文

c# vs VB 变量表2006-10-28 11:34:00

【评论】 【打印】 【字体: 】 本文链接:http://blog.pfan.cn/otot/19759.html

分享到:

Class Library Name  VB Name  C# Name Contains
Byte Byte byte An integer from 0 to 255.
Int16  Short short  An integer from –32,768 to 32,767.
Int32  Integer  int  An integer from –2,147,483,648 to 2,147,483,647.
Int64  Long long An integer from about –9.2e18 to 9.2e18.
Single Single float  A single-precision floating point number from approximately –3.4e38 to 3.4e38.
Double Double double A double-precision floating point number from
 approximately –1.8e308 to 1.8e308.
Decimal  Decimal  decimal A 128-bit fixed-point fractional number that
 supports up to 28 significant digits.
Char Char char A single 16-bit Unicode character.
String String string A variable-length series of Unicode characters.
Boolean  Boolean  bool A true or false value.
DateTime Date *  Represents any date and time from 12:00:00 AM,
 January 1 of the year 1 in the Gregorian calendar,
 to 11:59:59 PM, December 31 of the year 9999.
 Time values can resolve values to 100 nanosecond
 increments. Internally, this data type is stored as a 64-bit integer.
TimeSpan *  *  Represents a period of time, as in ten seconds or
 three days. The smallest possible interval is 1 tick
 (100 nanoseconds).
Object  Object object The ultimate base class of all .NET types. Can
 contain any data type or object.
*代表,这种类型在此语言中没有定义,但这种类型是实际存在的,当然也是可以使用的,例如C#要使用TimeSpan类型,可以这样来定义,
TimeSpan mytime;/*我想,要使用TimeSpan类型,必须得加上一个前缀,例如System.Time.TimeSpan,这个不一定正确,只是打个比方*/
其他存在的数据类型也可以这样定义.

阅读(4415) | 评论(0)


版权声明:编程爱好者网站为此博客服务提供商,如本文牵涉到版权问题,编程爱好者网站不承担相关责任,如有版权问题请直接与本文作者联系解决。谢谢!

评论

暂无评论
您需要登录后才能评论,请 登录 或者 注册