C# .NET 利用系统API生成有序GUID

[DllImport("rpcrt4.dll", SetLastError = true)]
static extern int UuidCreateSequential(out Guid guid);

public static Guid GenerateSequentialGuid()
{
    Guid guid;
    int result = UuidCreateSequential(out guid);
    if (result != 0)
    {
        throw new ApplicationException("Create sequential guid failed: " + result);
    }
    return guid;
}
—— 完 ——
相关推荐
评论

立 为 非 似

中 谁 昨 此

宵 风 夜 星

。 露 , 辰

文章点击榜

细 无 轻 自

如 边 似 在

愁 丝 梦 飞

。 雨 , 花