function FileINUse(filename:String):boolean;
var
usein:file;
begin
result:=false;
assignsignm(usein,FileName); reset(Usein);
except
on E:EInOutError do
🎜> result:=true;
exit ;
end;
end;
end;
closefile(usein);
end;
procedure TForm1.Button1Click(Sender: TObject);
if OpenDialog1.Execute then
begin
ShowMessage('文件正在使用中')
else
ShowMessage('沒有使用');
end;