Share via


Windows 執行階段基底資料類型

下表列出Windows 執行階段支援的基底資料類型,並指出 C#、Visual Basic 和 C++ 中的對應類型。

資料類型 JavaScript C# VB C++
布林值 布林值 bool 布林值 bool
位元組 Number byte 位元組 unsigned char
Char String char Char unsigned char
Char16 String char Char wchar_t
DateTime 日期 DateTimeOffset DateTimeOffset DateTime
Double Number double Double double
Guid String Guid Guid Guid
Int16 Number short Short short
Int32 Number int 整數 int
Int64 Number long Long __int64
Object Object object Object 物件^
Rect Rect Rect Rect Rect
Single Number float Single float
大小 大小 大小 大小 大小
String String string String 字串^
TimeSpan Number TimeSpan TimeSpan TimeSpan
UInt8 Number byte 位元組 unsigned char
UInt16 Number ushort UShort unsigned short
UInt32 Number uint UInteger 不帶正負號的整數
UInt64 Number ulong ULong unsigned __int64
Uri Uri Uri Uri Uri^
Void 未定義 void Void void

 

下表指出對應至Windows 執行階段資料類型的 .NET 類型。

Windows 執行階段 .NET
布林值 System.Boolean
位元組 System.Byte
Char System.Char
Char16 System.Char
DateTime System.DateTimeOffset
Double System.Double
Guid System.Guid
Int16 System.Int16
Int32 System.Int32
Int64 System.Int64
Object System.Object
Single System.Single
String System.String
TimeSpan System.TimeSpan
UInt8 System.Byte
UInt16 System.UInt16
UInt32 System.UInt32
UInt64 System.UInt64
Uri System.Uri
Void System.Void