Delphi取得目前檔案位置名稱路徑

[pascal]
// 假如程式路徑在 c:\projects\bin\project1.exe
ShowMessage(‘Drive = ‘+ExtractFileDrive (Application.Exename)); //C:
ShowMessage(‘Dir = ‘+ExtractFileDir (Application.Exename)); //c:\projects\bin
ShowMessage(‘Path = ‘+ExtractFilePath (Application.Exename)); //c:\projects\bin\
ShowMessage(‘Name = ‘+ExtractFileName (Application.Exename)); //project1.exe
ShowMessage(‘OnlyName =’+ChangeFileExt(ExtractFileName(Application.Exename), ”)); //project1
ShowMessage(‘Ext = ‘+ExtractFileExt (Application.Exename)); //.exe
[/pascal]

作者: 林壽山

林壽山 軟體公司專案經理,第三方支付設計(綠界、馬來西亞epay/happypay、台新one碼),金流設計,行動支付設計(悠遊卡/一卡通),支付寶,微信,街口支付,信用卡機(聯合信用卡),擅長PHP網頁設計(CodeIgniter、Laravel)框架、Delphi程式設計、資料庫設計、C# WinForm/WebForm程式設計、ASP.net MVC、LINE串接、API串接設計