Y
yukuang
Unregistered / Unconfirmed
GUEST, unregistred user!
时好时坏,刚才好好的,不知怎么动了动程序,就出现了上面的错误。
这是我的代码:
VCLUZ:=TVCLUnZip.Create(Application);
try
try
with VCLUZ do
begin
RecreateDirs:=true;
DoAll:=true;
ReplaceReadOnly:=true;
OnPromptForOverwrite:=VCLUZPromptForOverwrite;
ClearZip;
DestDir:=DETo.Text ;//*********************这一行如果我写为DestDir='e:/'或什么别的常量都没问题
RootDir :=DESource.Text ;
PB.Position :=0;
PB.Max :=FB.Items.Count;
Ltotal.Caption := IntToStr(FB.Items.Count);
for i:=0 to FB.Items.Count-1 do
begin
Lnow.Caption :=IntToStr(PB.Position+1);
Lnow.Update;
PB.Position :=PB.Position+1;
ClearZip;
ZipName:= FB.Items;
unzip;
end;
ClearZip;
end;
MessageDlg('Íê±Ï',mtInformation,[mbyes],0);
except
on e:Exception do
MessageDlg('½âѹ´íÎó.'+e.Message,mtError,[mbyes],0);
end;
finally
DESource.ReadOnly :=false;
DETo.ReadOnly :=false;
VCLUZ.Free;
end;
end;
这是我的代码:
VCLUZ:=TVCLUnZip.Create(Application);
try
try
with VCLUZ do
begin
RecreateDirs:=true;
DoAll:=true;
ReplaceReadOnly:=true;
OnPromptForOverwrite:=VCLUZPromptForOverwrite;
ClearZip;
DestDir:=DETo.Text ;//*********************这一行如果我写为DestDir='e:/'或什么别的常量都没问题
RootDir :=DESource.Text ;
PB.Position :=0;
PB.Max :=FB.Items.Count;
Ltotal.Caption := IntToStr(FB.Items.Count);
for i:=0 to FB.Items.Count-1 do
begin
Lnow.Caption :=IntToStr(PB.Position+1);
Lnow.Update;
PB.Position :=PB.Position+1;
ClearZip;
ZipName:= FB.Items;
unzip;
end;
ClearZip;
end;
MessageDlg('Íê±Ï',mtInformation,[mbyes],0);
except
on e:Exception do
MessageDlg('½âѹ´íÎó.'+e.Message,mtError,[mbyes],0);
end;
finally
DESource.ReadOnly :=false;
DETo.ReadOnly :=false;
VCLUZ.Free;
end;
end;