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

public static Guid GenGuid()
{
    const int RPC_S_OK = 0;
    Guid guid;
    int result = UuidCreateSequential(out guid);
    if (result != RPC_S_OK)
    {
        throw new ApplicationException("Create sequential guid failed: " + result);
    }

    return guid;
}
View Code

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-26
  • 2022-12-23
  • 2022-12-23
  • 2022-02-09
猜你喜欢
  • 2021-10-22
  • 2022-03-09
  • 2021-07-29
  • 2021-08-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案