Delphi - 生成GUID
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;
参考: