c++获得当前目录的两种方法

来源:互联网 发布:ssh 本地端口转发 编辑:程序博客网 时间:2024/06/06 03:44

 一、

TCHAR   exeFullPath[100];  
 GetModuleFileName(NULL,exeFullPath,100);
 CString path=exeFullPath;

二、

 CString strPath;
 GetCurrentDirectory(MAX_PATH , strPath.GetBuffer(MAX_PATH));

 strPath.ReleaseBuffer();

原创粉丝点击