(Gast)
n/a Beiträge
|
Re: IF ..... AND -> Wie schließen?
11. Feb 2004, 16:43
Delphi-Quellcode:
If (Label1.Caption='xxxxxxx') AND Fileexists('C:\xxxxxxx') THEN
begin
with AbCabExtractor1 do
begin
FileName := ExtractFilePath(paramstr(0))+'xxx.cab';
BaseDirectory := 'c:\xxx';
//So dürfte die Ausgabe mit Abbrevia-Komponenten funktionieren
ArchiveProgressMeter:=AbVCLMeterLink1;
AbVCLMeterLink1.Meter:=AbMeter1;
try
ExtractFiles('xxxxx');
// Progressbar1.StepIt; mhh... soweit ich weiss funzt das net mit Abbrevia. Besser siehe oben
except
Showmessage('Fehler.');
end;
end;
with AbUnzipper1 do
begin
FileName := 'c:\xxxxxxx';
BaseDirectory := ABCabExtractor1.BaseDirectory;
ABUnzipper1.Password:='xx';
ExtractFiles( 'xxxx' );
//Progressbar1.StepIt; siehe oben
ArchiveProgressMeter:=AbVCLMeterLink2;
AbVCLMeterLink2.Meter:=AbMeter2;
end;
RenameFile('C:\xxxx','C:\xxxx.xxx');
Progressbar1.StepIt;
ShellExecute(0, nil, PChar('c:\xxxx.xxx'), nil, nil, sw_Show);
Progressbar1.StepIt;
Progressbar1.Visible:=False;
ABUnzipper1.CloseArchive;
DeleteFile('xxxxxxxxx');
end
ELSE
begin
with AbCabExtractor1 do
begin
FileName := ExtractFilePath(paramstr(0))+'xxx';
BaseDirectory := 'xxxx';
try
ExtractFiles('xxxxx');
// Progressbar1.StepIt;
finally
end;
end;
with AbUnzipper1 do
begin
FileName := 'c:\xxxxxx';
BaseDirectory := ABCabExtractor1.BaseDirectory;
ABUnzipper1.Password:='xx';
ExtractFiles( 'xxxx' );
Progressbar1.StepIt;
end;
RenameFile('C:\xxx','C:\xxxxx.xxx');
Progressbar1.StepIt;
ShellExecute(0, nil, PChar('c:\xxxx'), nil, nil, sw_Show);
Progressbar1.StepIt;
Progressbar1.Visible:=False;
ABUnzipper1.CloseArchive;
DeleteFile('xxxxx');
end;
|
|
Zitat
|