Вниз
Скачать: CL | DM;

Копирование   Найти похожие ветки 

← →
Opera ©   (2003-02-27 16:40) [0]

Помогите с кодом...
Чтобы программа копировала сама себя например в папку windows


← →
Opera ©   (2003-02-27 17:07) [1]

Что???
Ч Т О ?
Никто не знает?


← →
DVE   (2003-02-27 17:19) [2]

НИкто не отвечает!!!

HELP почитай

procedure TForm1.Save1Click(Sender: TObject);

var
NewFileName: string;
Msg: string;
NewFile: TFileStream;
OldFile: TFileStream;
begin
NewFileName := ExtractFilePath(Application.ExeName) + ExtractFileName(Edit1.Text);
Msg := Format("Copy %s to %s?", [Edit1.Text, NewFileName]);
if MessageDlg(Msg, mtConfirmation, mbOKCancel, 0) = mrOK then
begin
OldFile := TFileStream.Create(Edit1.Text, fmOpenRead or fmShareDenyWrite);
try
NewFile := TFileStream.Create(NewFileName, fmCreate or fmShareDenyRead);

try
NewFile.CopyFrom(OldFile, OldFile.Size);
finally
FreeAndNil(NewFile);
end;
finally
FreeAndNil(OldFile);
end;
end;

end;


← →
Roma ©   (2003-02-27 17:38) [3]

>Opera © (27.02.03 16:40)

uses
ShellApi;

procedure TForm1.Button1Click(Sender: TObject);
var
FileOpStruct: TSHFileOpStruct;
WinDir: array [0..255] of Char;
Len: Integer;
begin
GetWindowsDirectory(WinDir, Len);
with FileOpStruct do
begin
wFunc := FO_COPY;
pFrom := PChar(Application.ExeName);
pTo := WinDir;
end; // with FileOperation do
SHFileOperation(FileOpStruct);
end; // procedure TForm1.Button1Click(Sender: TObject);



Страницы: 1 вся ветка

Скачать: CL | DM;



Память: 0.45 MB
Время: 0.013 c
3-29758
гончий
2003-02-19 15:36
2003.03.10
Вышлите мне пару табличек Btrieve


8-29957
Juss
2002-11-25 18:24
2003.03.10
Создания карты


8-29959
STANT
2002-11-29 15:17
2003.03.10
В чем проблема?


3-29729
F1
2003-02-19 11:05
2003.03.10
AV при ADOQuery.ExecSQL


6-29971
Anton
2003-01-17 11:16
2003.03.10
Почта




   Наверх