Delphi - 生成GUID

时间:2021-02-15 12:21:06   收藏:0   阅读:0

uses   SysUtils;

// 生成GUID
function TForm2.GetGUID: string;
var
  LTep: TGUID;
  sGUID: string;
begin
  CreateGUID(LTep);
  sGUID := GuidToString(LTep);
  sGUID := StringReplace(sGUID, ‘-‘, ‘‘, [rfReplaceAll]);
  sGUID := Copy(sGUID, 2, length(sGUID) - 2);
  Result := sGUID;
end;

 

参考:

https://www.cnblogs.com/xwgcxk/p/7233683.html  

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!