获取C#中值类型UInt32的TypeCode
要获取值类型 UInt32 的 TypeCode,代码如下 -
示例
using System; public class Demo { public static void Main() { uint val1 = 55; uint val2 = 100; TypeCode type1 = val1.GetTypeCode(); TypeCode type2 = val2.GetTypeCode(); Console.WriteLine("Typecode for val1 = "+type1); Console.WriteLine("Typecode for val2 = "+type2); } }
输出
这将生成以下输出 -
Typecode for val1 = UInt32 Typecode for val2 = UInt32
示例
我们来看另一个示例 -
using System; public class Demo { public static void Main() { uint val1 = UInt32.MinValue; uint val2 = 0; TypeCode type1 = val1.GetTypeCode(); TypeCode type2 = val2.GetTypeCode(); Console.WriteLine("Typecode for val1 = "+type1); Console.WriteLine("Typecode for val2 = "+type2); } }
输出
这将生成以下输出 -
Typecode for val1 = UInt32 Typecode for val2 = UInt32
广告