Показать сообщение отдельно
  #5  
Старый 22.03.2008, 18:39
aesoem aesoem вне форума
Прохожий
 
Регистрация: 07.03.2008
Сообщения: 19
Репутация: 10
По умолчанию

чот я не пойму так чтоли
Код:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, sButton;

type
  TForm1 = class(TForm)
    sButton1: TsButton;
    procedure sButton1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}
private
    { Private declarations }
  public
    { Public declarations }
  end;
   procedure FileCopy(const SourceFileName, TargetFileName: string);
   implementation

{$R *.DFM}

procedure FileCopy(const SourceFileName, TargetFileName: string);
var
  S, T : TFileStream;
begin
  S := TFileStream.Create(sourcefilename, fmOpenRead );
  try
    T := TFileStream.Create(targetfilename, fmOpenWrite or fmCreate);
    try
      T.CopyFrom(S, S.Size ) ;
      FileSetDate(T.Handle, FileGetDate(S.Handle));
    finally
      T.Free;
    end;
  finally
    S.Free;
  end;
end;
   procedure TForm1.sButton1Click(Sender: TObject);
begin
filecopy('c:\folder','d:\folder2');
end;

end.

Admin: Читаем правила форума по офрормлению кода, иначе последуют санкции.
Ответить с цитированием