unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs,shellapi, StdCtrls, WinSkinData;
type
TForm1 = class(TForm)
Label1: TLabel;
Button1: TButton;
Label2: TLabel;
Button2: TButton;
Edit1: TEdit;
Button4: TButton;
SkinData1: TSkinData;
Label3: TLabel;
Button3: TButton;
OpenDialog1: TOpenDialog;
procedure Button1Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
ch: Char;
s: string;
implementation
{$R *.dfm}
// ˜í ÏÇíј&am p;Ecirc;æÑí
procedure CopyFolder(SrcFolder, DstFolder : String);
var
SearchRec : TSearchRec;
Src, Dst : String;
begin
Src := IncludeTrailingBackslash(SrcFolder);
Dst := IncludeTrailingBackslash(DstFolder);
ForceDirectories(Dst);
if FindFirst(Src + '*.*', faAnyFile, SearchRec) = 0 then
try
repeat
with SearchRec do
if (Name <> '.') and (Name <> '..') then
if (Attr and faDirectory) > 0 then
CopyFolder(Src + Name, Dst + Name)
else
CopyFile(Pchar(Src + Name), PChar(Dst + Name), True);
until FindNext(SearchRec) <> 0;
finally
FindClose(SearchRec);
end ;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
Button4.Visible := true;
Edit1.Visible := true;
Label3.Visible := true;
end;
procedure TForm1.Button4Click(Sender: TObject);
// &iacute;&Iuml;&Ccedil; ˜&Ntilde;&Iuml;&auml; &Oacute;&iacute; &Iuml;&iacute; &Ntilde;&Ccedil;&atilde;
var
a : string;
begin
for ch := 'D' to 'Z' do
begin
s := ch + ':\';
if GetDriveType(PChar(s)) = DRIVE_CDROM then begin
a := s ;
CopyFolder(a ,Edit1.Text + 'MultiMedia');
end;
end;
close;
end;
end.