动态生成GUID
C#语句:
for(int i = 0;i<50;i++)
{
Response.Write(@"<br>System.Guid.NewGuid().ToString() = " + System.Guid.NewGuid().ToString());
Response.Write(@"<br>System.Guid.NewGuid().ToString(""N"") = " + System.Guid.NewGuid().ToString("N"));
Response.Write(@"<br>System.Guid.NewGuid().ToString(""D"") = " + System.Guid.NewGuid().ToString("D"));
Response.Write(@"<br>System.Guid.NewGuid().ToString(""B"") = " + System.Guid.NewGuid().ToString("B"));
Response.Write(@"<br>System.Guid.NewGuid().ToString(""P"") = " + System.Guid.NewGuid().ToString("P"));
}
DELPHI:
uses
ActiveX,ComObj;
function GetGUID: string;
var
id: TGUID;
begin
if CoCreateGuid(id) = s_ok then
Result := GUIDToString(id);
end;