中文字幕av专区_日韩电影在线播放_精品国产精品久久一区免费式_av在线免费观看网站

溫馨提示×

ExtractFilePath - C++ Builder

c++
小云
83
2023-09-28 07:04:34
欄目: 編程語言

ExtractFilePath is a function in C++ Builder that is used to extract the directory path from a given file path.

Syntax:

AnsiString ExtractFilePath(const AnsiString& path);

Parameters:

  • path: The input file path from which the directory path needs to be extracted.

Return Value:

  • The directory path extracted from the input file path.

Example:

#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
#include <System.IOUtils.hpp>
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
void __fastcall TForm1::Button1Click(TObject *Sender)
{
AnsiString filePath = "C:\\Program Files\\MyApp\\data\\file.txt";
AnsiString directoryPath = ExtractFilePath(filePath);
ShowMessage(directoryPath);
}

In the above example, the ExtractFilePath function is used to extract the directory path “C:\Program Files\MyApp\data\” from the file path “C:\Program Files\MyApp\data\file.txt”. The extracted directory path is then displayed using the ShowMessage function.

0
南华县| 延川县| 乐安县| 新蔡县| 固阳县| 闻喜县| 永登县| 固安县| 武威市| 滕州市| 化德县| 砚山县| 长泰县| 南宁市| 翁牛特旗| 安达市| 拜泉县| 修水县| 嘉义市| 东港市| 工布江达县| 长阳| 花莲市| 桃园县| 顺平县| 寻乌县| 芦溪县| 铁岭县| 泽普县| 泌阳县| 绍兴县| 行唐县| 新津县| 宁波市| 那曲县| 武冈市| 石家庄市| 镇坪县| 南平市| 昌黎县| 常山县|