取得執行檔的完整路徑
String name = Application->ExeName;
//C:\\Borland\\CBuilder6\\Projects\\Project1.exe
取出檔案名稱
name = ExtractFileName(name);
// Project1.exe
改變副檔名
name = ChangeFileExt(name,".TXT");
//Project1.TXT
取出路徑(含斜線, 不支援反斜線)
name = ExtractFilePath(Application->ExeName);
//C:\Borland\CBuilder6\Projects\
取出路徑(不含斜線, 不支援反斜線)
name = ExtractFileDir(Application->ExeName);
//C:\Borland\CBuilder6\Projects
取出目錄名稱(在linux永遠是空白)
name = ExtractFileDrive(Application->ExeName);
//C:
取出副檔名
name = ExtractFileExt(Application->ExeName);
//.exe
沒有留言:
張貼留言