本文整理自网络,侵删。
uses ComObj,ActiveX ;
function 生成全球唯一标识符: string;
var
ID:TGUID;
begin
while True do
begin
if CoCreateGuid(ID)=s_OK then
begin
Result:=GUIDToString(ID) ;
Result:=StringReplace(Result,'{','',[rfReplaceAll]) ;
Result:=StringReplace(Result,'}','',[rfReplaceAll]) ;
Result:=StringReplace(Result,'-','',[rfReplaceAll]) ;
Exit ;
end;
end;
end;
相关阅读 >>
Delphi ioutils tdirectory获取一个目录下所有文件名,包括子目录
更多相关阅读请进入《Delphi》频道 >>