ExtractFilePath是什莫意思?在线等?

解决方案 »

  1.   

    Returns the drive and directory portions of a file name. 
    返回一个文件的路径
      

  2.   

    ExtractFilePath(ParamStr(0))是什莫意思?
      

  3.   

    function ExtractFilePath(const FileName: string): string;
    Returns the drive and directory portions of a file name. 
    DescriptionThe resulting string is the leftmost characters of FileName, up to and including the colon or backslash that separates the path information from the name and extension. The resulting string is empty if FileName contains no drive and directory parts.Note: This function works for multi-byte character systems (MBCS).
    反回文件的驱动器和路径的名字
      

  4.   

    ExtractFilePath(ParamStr(0))可执行文件的路径和名字
      

  5.   

    ExtractFilePath(Paramstr(0));
    extractfilepath(application.exename);
    返回应用程序本身所在的文件夹ExtractFilePath('c:\xx\abc.txt');
    结果是
    c:\xx\
      

  6.   

    Delphi 1.0 请用
           ExtractFilePath(Application.Exename); (因为没有 ExtractFileDir() 函
           数)
           Delphi 2.0 的 SysUtils 单元中有 ExtractFileDir 与 ExtractFilePath
           两个类似的函数, 用哪一个并没有太大的关系, 不过有以下的差异:
           [INLINE]  ExtractFilePath 传回值的最後一个字元是反斜线
    procedure TForm1.Button1Click(Sender: TObject);
    begin
      ShowMessage(ExtractFileDir(Application.Exename));
      (* ==> ie: c:\temp *)
      ShowMessage(ExtractFilePath(Application.Exename));
      (* ==> ie: c:\temp\ *)
    end;
           [INLINE]  相同的是,
           [INLINE] 1. 只有档名时, 两者传回值都是空字串; 另外,
           [INLINE] 2. 如果传入的引数为 C:\Temp.txt 的话, 两者的传回值的最後字
           元都是 '\'