string GetExePath(void) { char Path[256]={0}; GetModuleFileNameA(NULL, szFilePath, 255); (strrchr(Path, '\\'))[0] = 0; // 删除文件名,只获得路径字串 string path = szFilePath; return path; }