if FileExists('路径'+文件名) then application.messagebox('文件存在','提示',mb_ok) else application.messagebox('文件不存在','提示',mb_ok) 调用文件是什么意思! ExtractFileDir 看是否为空,
调用执行文件; winexec(路径\ 文件 );
winexec(路径\ 文件 );
var f: File; filename:string; size: Longint; begin filename:='m:\tt.txt'; if FileExists(filename) then begin ShellExecute(0, 'open', PChar(filename), nil, nil, SW_SHOWNORMAL);//执行文件 AssignFile(f, filename); Reset(F, 1); size:=System.Filesize(F); if size=0 then showmessage('文件为空'); CloseFile(f); end; end;
//path為文件所在的路徑! if FileExists(path) then Application.MessageBox('要覆蓋以存在的檔案嗎?',pchar(Application.Title),MB_OK+MB_ICONWARNING);
支持 hammer_shi(@活着真累@)
//path為文件所在的路徑! if FileExists(path) then Application.MessageBox('要覆蓋以存在的檔案嗎?',pchar(Application.Title),MB_OK+MB_ICONWARNING);//運行 winexec('C:\WINNT\SYSTEM32\calc.exe',sw_normal);//文件為空
then application.messagebox('文件存在','提示',mb_ok)
else application.messagebox('文件不存在','提示',mb_ok)
调用文件是什么意思!
ExtractFileDir 看是否为空,
f: File;
filename:string;
size: Longint;
begin
filename:='m:\tt.txt';
if FileExists(filename) then
begin
ShellExecute(0, 'open', PChar(filename), nil, nil, SW_SHOWNORMAL);//执行文件
AssignFile(f, filename);
Reset(F, 1);
size:=System.Filesize(F);
if size=0 then
showmessage('文件为空');
CloseFile(f); end;
end;
if FileExists(path) then
Application.MessageBox('要覆蓋以存在的檔案嗎?',pchar(Application.Title),MB_OK+MB_ICONWARNING);
if FileExists(path) then
Application.MessageBox('要覆蓋以存在的檔案嗎?',pchar(Application.Title),MB_OK+MB_ICONWARNING);//運行
winexec('C:\WINNT\SYSTEM32\calc.exe',sw_normal);//文件為空
append
assignfile
closefile
eof
eoln
filepos
filesize
getdir
read
readln
rename
reset
rewrite
rmdir
seek
write
writeln~~~呵呵,泡分ing
begin
if FileExists(ShellListView1.SelectedFolder.PathName) then // 判断是不是文件
ShellExecute(0, 'open', PChar(ShellListView1.SelectedFolder.PathName), nil, nil, SW_SHOWNORMAL);
end;