美文网首页
ExtractFileDir - C++ Builder

ExtractFileDir - C++ Builder

作者: 玄坴 | 来源:发表于2021-11-08 15:47 被阅读0次

C++ Builder 参考手册System::SysutilsExtractFileDir


从路径和文件名里面提取驱动器和路径部分

头文件:#include <System.SysUtils.hpp>
命名空间:System::Sysutils
函数原型:

System::UnicodeString __fastcall ExtractFileDir(const System::UnicodeString FileName);

参数:

  • FileName 路径和文件名,字符串;

返回值:

  • 从路径和文件名里面的驱动器和路径部分。

例子:获取应用程序的路径 (当前 exe 文件的文件夹位置)

void __fastcall TForm1::Button1Click(TObject *Sender)
{
    UnicodeString s = Application->ExeName;
    Memo1->Lines->Add(s);
    s = Sysutils::ExtractFileDir(s);
    Memo1->Lines->Add(s);
}

运行结果:

运行结果

相关:

  • System::Sysutils::ChangeFileExt
  • System::Sysutils::ChangeFilePath
  • System::Sysutils::ExtractFileDir
  • System::Sysutils::ExtractFileDrive
  • System::Sysutils::ExtractFileExt
  • System::Sysutils::ExtractFileName
  • System::Sysutils::ExtractFilePath
  • System::Sysutils::ExtractRelativePath
  • System::Sysutils::ExtractShortPathName
  • System::Sysutils
  • std::_fullpath, std::_tfullpath, std::_wfullpath
  • std::_makepath, std::_tmakepath, std::_wmakepath
  • std::_splitpath, std::_tsplitpath, std::_wsplitpath
  • <cstdlib>

C++ Builder 参考手册System::SysutilsExtractFileDir

相关文章

网友评论

      本文标题:ExtractFileDir - C++ Builder

      本文链接:https://www.haomeiwen.com/subject/hcmdahtx.html