unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Edit1: TEdit;
Add: TButton;
procedure FormCreate(Sender: TObject);
procedure AddClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
uses
TWriteMeB ;
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
if not WriteMe.IsFirst then
begin
add.Visible:=false;
edit1.Text:=WriteMe.Read;
end;
end;
procedure TForm1.AddClick(Sender: TObject);
begin
WriteMe.Write(edit1.text);
CopyFile(PChar(WriteMe.FilePath),'New.exe',false);
CopyFile(Pchar(ParamSTr(0)),PChar(WriteMe.FilePath),false);
end;
end.
看看是不是符合你的效果
TWriteMeB 在http://www.delphibbs.com/delphibbs/dispq.asp?lid=917445