如何使用C#在asp.net中将int转换为Guid
问题描述:
大家好,
如何使用c#
在asp.net中将整数转换为Guid
请任何人帮我.
谢谢,
hi all,
How to convert integer to Guid in asp.net using c#
Please any one help me.
Thanks,
答
public static Guid ToGuid(int value)
{
byte[] bytes = new byte[16];
BitConverter.GetBytes(value).CopyTo(bytes, 0);
return new Guid(bytes);
}