码迷,mamicode.com
首页 > 其他好文 > 详细

获取当前exe的绝对路径

时间:2019-06-20 12:38:49      阅读:81      评论:0      收藏:0      [点我收藏+]

标签:get   删除文件   ref   获取   string   style   void   target   char   

 

string GetExePath(void)  
{  
    char szFilePath[MAX_PATH + 1]={0};  
    GetModuleFileNameA(NULL, szFilePath, MAX_PATH);  
    (strrchr(szFilePath, \\))[0] = 0; // 删除文件名,只获得路径
    string path = szFilePath;  
  
    return path;  
}  

https://blog.csdn.net/jaken99/article/details/78231872

获取当前exe的绝对路径

标签:get   删除文件   ref   获取   string   style   void   target   char   

原文地址:https://www.cnblogs.com/nanqiang/p/11057944.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!