procedure TForm1.Button1Click(Sender: TObject);
begin
showmessage(application.ExeName );
end;

解决方案 »

  1.   

    strExeFilePath:string; 
    strExeFilePath:=ExtractFileDir(ParamStr(0));
      

  2.   

    ExtractFilePath(Application.ExeName) ;
      

  3.   

    ExtractFilePath(Application.ExeName)
    ExtractFiledir(Application.ExeName)
      

  4.   


    ExtractFilePath(Application.ExeName)  有“\”
    ExtractFiledir(Application.ExeName)   没有“\”
    以上的够你的用了
      

  5.   

    但用win  api
    DWORD GetModuleFileName(
      HMODULE hModule,    // handle to module to find filename for
      LPTSTR lpFilename,  // pointer to buffer to receive module path
      DWORD nSize         // size of buffer, in characters
    );