请问怎样在delphi 7里面实现打开一个文件,并显示其路径

解决方案 »

  1.   

             with TOpenDialog.Create(self) do
             try
                 if Execute then
                 begin
                     Edit1.text:=FileName; 
                 end;
             finally
               Free;
             end;
      

  2.   

        with TOpenDialog.Create(self) do
            try
                if Execute then
                begin
                    Edit1.text:=ExtractFilePath(FileName);
                end;
            finally
              Free;
            end;
      

  3.   

    啥文件?OPENDIALOG可以返回文件名
      

  4.   

     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;