c++获取程序路径

来源:互联网 发布:淘宝钻展设计 编辑:程序博客网 时间:2024/06/14 19:21
  1. string GetExePath(void)  
  2. {  
  3.     char Path[256]={0};  
  4.     GetModuleFileNameA(NULL, szFilePath, 255);  
  5.     (strrchr(Path'\\'))[0] = 0; // 删除文件名,只获得路径字串  
  6.     string path = szFilePath;  
  7.   
  8.     return path;
  9. }  
1 0
原创粉丝点击