判斷文件是否正在被使用的JS代碼
//判斷文件是否正在被使用
function FileINUse(filename:String):boolean;
var
usein:file;
begin
result:=false;
assignfile(usein,FileName);
try
reset(Usein);
except
on E:EInOutError do
begin
if e.ErrorCode=32 then
begin
result:=true;
exit;
end;
end;
end;
closefile(usein);
end;
procedure TForm1.Button1Click(Sender: TObject);
if OpenDialog1.Execute then
begin
if fileInuse(OpenDialog1.filename) then
ShowMessage('文件正在使用中')
else
ShowMessage('沒有使用');
end;
相關文章
javascript轉換字符串為dom對象(字符串動態(tài)創(chuàng)建dom)
那么今天的目的就是教大家怎么去實現一個這樣的方法用來把字符串直接轉換為標準的dom對象2010-05-05
js動態(tài)調用css屬性的小規(guī)律及實例說明
本篇文章主要介紹了js動態(tài)調用css屬性的小規(guī)律及實例說明。需要的朋友可以過來參考下,希望對大家有所幫助2013-12-12

