亚洲激情专区-91九色丨porny丨老师-久久久久久久女国产乱让韩-国产精品午夜小视频观看

溫馨提示×

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
嘉兴市| 海南省| 芜湖县| 莒南县| 靖宇县| 舟曲县| 郑州市| 体育| 乐陵市| 错那县| 苍山县| 台北市| 凤阳县| 都江堰市| 辽中县| 贺州市| 北京市| 宿松县| 陈巴尔虎旗| 吉安市| 永兴县| 仪陇县| 钦州市| 邵阳县| 阳西县| 兖州市| 安西县| 陆河县| 金山区| 阿坝| 会东县| 仪征市| 保亭| 桃源县| 伊通| 湘阴县| 改则县| 镇平县| 手游| 聊城市| 泸州市|