见题

解决方案 »

  1.   

    procedure TForm.GetAppDir(var AppDir: string);
    var
      hModule:THandle;
      buf:array [0..MAX_PATH-1] of char;
    begin
      hModule:=GetModuleHandle(nil);
      GetModuleFileName(hmodule,buf,sizeof(buf));
      AppDir:=buf;
    end;
      

  2.   

    function TForm1.PathExeDir: string;
    var FileName:string;
    begin
      FileName:=application.GetNamePath;
      Result := ExtractFilePath(ParamStr(0)) + FileName;
    end;
    procedure TForm1.Button2Click(Sender: TObject);
    begin
      edit1.Text:= PathExeDir;
    end;
      

  3.   

    ShowMessage(ExtractFilePath(Application.ExeName));
      

  4.   

    ExtractFilePath(Application.ExeName)或者
    ExtractFilePath(ParamStr(0))————————————————————————————————————
    宠辱不惊,看庭前花开花落,去留无意;毁誉由人,望天上云卷云舒,聚散任风。
    ————————————————————————————————————
      

  5.   

    s:=ExtractFilePath(Application.ExeName);
      

  6.   

    var
      path,bpath:string;
    begin
      getdir(0,bpath);
      path:=bpath+'\HELP.hlp';
      

  7.   


     getdir(0,bpath);bpath变量中存的就是路径!
      

  8.   

    extractfilepath(application.exename);