你试试下面这两个函数,应该可以搞定你的问题
Function CreateUniqueClassID: string;
var GUID: TGUID;
WCLID: array[0..127] of WideChar;
begin
OleCheck(CoCreateGUID(GUID));
StringFromGuid2(GUID,WCLID,SizeOf(WCLID) div 2);
Result:=WideCharToString(WCLID)
end;
Function RetNetID:String;
var
S:String;
begin
S:=CreateUniqueClassID;
Result:=Copy(S,26,12);
end;