ExtractFilePath(Application.ExeName)这样就可以得到一个路径!

解决方案 »

  1.   

    ExtractFileDir(Application.ExeName);
    :)
      

  2.   

    //给你一段代码,也许对你有用
    procedure keresrekurziv(p:string;filem:string);//p 代表盘符;filem文件名称
    var sr:Tsearchrec;
        fileattrs:integer;
        pp:string;
        hol:integer;
        ks1,ks2:string;
        begin
    fileattrs:=faAnyfile;
    chdir(p);
    if FindFirst('*.*', FileAttrs, sr) = 0 then begin
     while FindNext(sr) = 0 do begin
      if vege then break;
     application.processmessages;
       if (sr.Attr=  faDirectory)  and (sr.name <> '.' ) and (sr.name <> '..') then begin
        pp:=p;
        p:=p+sr.name+'\';
        keresrekurziv(p,filem);
        p:=pp;
       end;
       hol:=pos('*',filem);
       if hol <> 0 then begin
        ks1:=uppercase(copy(filem,1,hol-1));
        ks2:=uppercase(copy(filem,hol+1,length(filem)-1));
       end;
       if (hol=0) and (uppercase(filem) = uppercase(sr.name)) then form1.richedit1.Lines.Add(p+sr.name);   if form1.richedit1.text<>'' then   vege:=true;
       
       if (hol <> 0) then begin
        if pos(ks1,uppercase(sr.name))<>0 then form1.richedit1.Lines.Add(p+sr.name);
        if pos(ks2,uppercase(sr.name))<>0 then form1.richedit1.Lines.Add(p+sr.name);
       end;
      end;
     end;
    FindClose(sr);
    end;
      

  3.   

    楼上的同学你可以看懂你的 东东吗?
    没有注释 我搞不懂 !
    ExtractFilePath(Application.ExeName)这样就可以得到一个路径!
    ExtractFileDir(Application.ExeName);Application.exeName 是什么啊
    我的 文件名字是   P_client.exe             (我记得这个函数要求的是   
     我如何使用这个函数?                         string 参数)
    具体给个事例?
      

  4.   

    ExtractFilePath是获得文件路径的函数
    如ExtractFilePath('c:\windows\test.txt')='c:\windows\'
    Application.ExeName是当前程序的完整程序名
    如你写的程序为myapp.exe,在d:\aaa\目录下运行,则
    Application.ExeName='d:\aaa\myapp.exe'
      

  5.   

    application.exename是表示当前应用程序的名字和路径。