首页 > 代码库 > delphi生成GUID

delphi生成GUID

 

uses   SysUtils;

 

 

function TCommonAll.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;

delphi生成GUID