本文主要是介绍BCB如何获取.exe所在的路径?,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
直接上代码:
//---------------------------------------------------------------------------#include <vcl.h>
#pragma hdrstop#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner): TForm(Owner)
{
}
//---------------------------------------------------------------------------void __fastcall TForm1::Button1Click(TObject *Sender)
{// .exe的路径ShowMessage(ExtractFilePath(Application->ExeName));
}
//---------------------------------------------------------------------------
貌似在VC++中没有这么方便。
这篇关于BCB如何获取.exe所在的路径?的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!