J
jonyhuang
Unregistered / Unconfirmed
GUEST, unregistred user!
以下这段程序当我用try excet 进行捕捉错误时不起作用,请各路高手帮我看看怎回事,谢谢!
var source:string;
ShFileOpStruct: TShFileOpStruct;
zc:boolean;
begin
zc:=true;
source:='//cw/d/KaraSongs/aa.swf';
fillchar(ShFileOpStruct, sizeof(ShFileOpStruct), 0);
with ShFileOpStruct do begin
Wnd:=Form1.Handle;
wFunc:=FO_delete;
pFrom:=PChar(source);
fFlags:=FOF_ALLOWUNDO;
try
ShFileOperation(ShFileOpStruct);
except
ShowMessage('文件拷贝失败');
zc:=false
exit;
end;
if zc=true then label1.caption:='ok';
if zc=false then label1.caption:='no';
end;
end;
end;
jony
var source:string;
ShFileOpStruct: TShFileOpStruct;
zc:boolean;
begin
zc:=true;
source:='//cw/d/KaraSongs/aa.swf';
fillchar(ShFileOpStruct, sizeof(ShFileOpStruct), 0);
with ShFileOpStruct do begin
Wnd:=Form1.Handle;
wFunc:=FO_delete;
pFrom:=PChar(source);
fFlags:=FOF_ALLOWUNDO;
try
ShFileOperation(ShFileOpStruct);
except
ShowMessage('文件拷贝失败');
zc:=false
exit;
end;
if zc=true then label1.caption:='ok';
if zc=false then label1.caption:='no';
end;
end;
end;
jony