Delphi UUID生成器 [英] Delphi UUID generator

查看:936
本文介绍了Delphi UUID生成器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Delphi有什么内置的东西来生成UUID?

解决方案

  ; 

{$ APPTYPE CONSOLE}

使用
SysUtils;

var

Uid:TGuid;
结果:HResult;

开始
结果:= CreateGuid(Uid);
if Result = S_OK then
WriteLn(GuidToString(Uid));
结束。

根据封面 CreateGuid()调用Windows API函数 CoCreateGuid()。


Does Delphi have anything built-in to generate UUIDs?

解决方案

program Guid;

{$APPTYPE CONSOLE}

uses
SysUtils;

var

Uid: TGuid;
Result: HResult;

begin
Result := CreateGuid(Uid);
if Result = S_OK then
   WriteLn(GuidToString(Uid));
end.

Under the covers CreateGuid() calls the Windows API function CoCreateGuid().

这篇关于Delphi UUID生成器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆