Windows 运行时基数据类型

下表列出了 Windows 运行时支持的基数据类型,并指示 C#、Visual Basic 和C++中的相应类型。

数据类型 JavaScript C# VB C++
布尔 布尔 布尔 布尔 布尔
字节 数字 字节 字节 无符号字符
Char 字符串 char Char 无符号字符
Char16 字符串 char Char wchar_t
DateTime 日期 DateTimeOffset DateTimeOffset DateTime
数字
Guid 字符串 Guid Guid Guid
Int16 数字
Int32 数字 int 整数 int
Int64 数字 Long __int64
对象 对象 对象 对象 Object^
Rect Rect Rect Rect Rect
单个 数字 浮点数 单个 浮点数
大小 大小 大小 大小 大小
字符串 字符串 字符串 字符串 String^
TimeSpan 数字 TimeSpan TimeSpan TimeSpan
UInt8 数字 字节 字节 无符号字符
UInt16 数字 ushort UShort 未签名的短
UInt32 数字 uint UInteger 未签名的 int
UInt64 数字 ulong ULong 未签名的__int64
Uri Uri Uri Uri Uri^
Void 未定义 void Void void

 

下表指示对应于 Windows 运行时数据类型的 .NET 类型。

Windows 运行时 。网
布尔 System.Boolean
字节 System.Byte
Char System.Char
Char16 System.Char
DateTime System.DateTimeOffset
System.Double
Guid System.Guid
Int16 System.Int16
Int32 System.Int32
Int64 System.Int64
对象 System.Object
单个 System.Single
字符串 System.String
TimeSpan System.TimeSpan
UInt8 System.Byte
UInt16 System.UInt16
UInt32 System.UInt32
UInt64 System.UInt64
Uri System.Uri
Void System.Void