• 您的位置我爱Aspx >> VB.Net >> VB.NET and C# 语法比较手册
  • VB.NET and C# 语法比较手册

  • 作者:aspxer  来源:internet  日期:2007-5-20 13:59:18  关键字:c#,.net
  • Byte

    Char (example: "A"c)

    Short, Integer, Long

    Single, Double

    Decimal

    Date

    Reference Types

    Object

    String

    Dim x As Integer

    Console.WriteLine(x.GetType()) @# Prints System.Int32

    Console.WriteLine(TypeName(x)) @# Prints Integer

    @# Type conversion

    Dim numDecimal As Single = 3.5

    Dim numInt As Integer

    numInt = CType(numDecimal, Integer) @# set to 4 (Banker@#s rounding)

    numInt = CInt(numDecimal) @# same result as CType

    numInt = Int(numDecimal) @# set to 3 (Int function truncates the decimal)

    Value Types

    bool

    byte, sbyte

    char (example: @#A@#)

    short, ushort, int, uint, long, ulong

    float, double

    decimal

    DateTime (not a built-in C# type)

    Reference Types

    object

    string

    我对这篇文章有话说?
  • 广告位招租,广告代号:content_468_15
  • 上一篇:开始你的第一个多语言版本的dotNET 应用程序(WinForm篇)
    下一篇:在VB.NET中应用Agent技术