with TOpenDialog.Create(self) do try if Execute then begin Edit1.text:=FileName; end; finally Free; end;
with TOpenDialog.Create(self) do try if Execute then begin Edit1.text:=ExtractFilePath(FileName); end; finally Free; end;
啥文件?OPENDIALOG可以返回文件名
with TOpenDialog.Create(self) do try if Execute then begin Edit1.text:=ExtractFilePath(FileName); end; finally Free; end;if Not FileExists(Edit1.Text) then application.messagebox('文件不存在','提示',mb_ok+mb_iconinformation) else //执行打开文件操作 end;
try
if Execute then
begin
Edit1.text:=FileName;
end;
finally
Free;
end;
try
if Execute then
begin
Edit1.text:=ExtractFilePath(FileName);
end;
finally
Free;
end;
try
if Execute then
begin
Edit1.text:=ExtractFilePath(FileName);
end;
finally
Free;
end;if Not FileExists(Edit1.Text) then
application.messagebox('文件不存在','提示',mb_ok+mb_iconinformation)
else
//执行打开文件操作
end;