欢迎光临 随枫玉雨的个人网站

Delphi生成GUID的例子



unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ActiveX, StdCtrls;
type
TForm1 = class(TForm)
btn1: TButton;
mmo1: TMemo;
lbl1: TLabel;
procedure btn1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;



var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.btn1Click(Sender: TObject);
var
I : Integer;
sGUID : string;
TmpGUID: TGUID;
begin
mmo1.Text:='' ;
for I := 0 to 9 do
begin
if CoCreateGUID(TmpGUID) = S_OK then
sGUID := GUIDToString(TmpGUID)
else
mmo1.Text:='Create GUID error!';
mmo1.Text:=mmo1.Text+sguid ;
end;
end;
end.

QQ号码免费申请,申请QQ号免费,免费申请QQ号,QQ版本更新官方网站

关于我们加入我们