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;

posted @ 2017-07-25 13:47  坤霸天下  阅读(5277)  评论(1编辑  收藏  举报