我试着在#1找到了一些解决方案,但我不能得到它的工作,我要开始从C .LOG(.txt文件)++,但包含路径的文件夹它可能有空间,所以当我尝试启动它,我得到一个错误说它无法找到该文件,因为多环芳烃(含空格)是错误的,这里是我的代码如下所示:空间系统()C++
void Log (unsigned int Code,...)
{
char currdate[11] = {0};
SYSTEMTIME t;
GetLocalTime(&t);
sprintf(currdate, "%02d:%02d:%02d", t.wHour, t.wMinute, t.wSecond);
PROCESSENTRY32 pe32;
FILE* FileHwnd1;
FileHwnd1 = fopen("TEST.log","a+");
fprintf(FileHwnd1,"[%s] Code: %X\n",currdate,Code);
fclose(FileHwnd1);
char buffer[MAX_PATH];
GetModuleFileName(NULL, buffer, MAX_PATH);
char Path[50];
wsprintf(Path,"start %s\\AntiHack.log",buffer);
system(Path);//Here is where i get the containing spaces path error
}
感谢。
通常你会环绕名与引号的空格。 – chris