- CString VengConfig::GetSysCheckTmpPath(void)
- {
- TCHAR TmpPath[MAX_PATH]={0};
- LPITEMIDLIST pidl;
- LPMALLOC pShellMalloc;
- if(SUCCEEDED(SHGetMalloc(&pShellMalloc)))
- {
- if(SUCCEEDED(SHGetSpecialFolderLocation(NULL,CSIDL_APPDATA ,&pidl)))
- {
- SHGetPathFromIDList(pidl, TmpPath);
- pShellMalloc->Free(pidl);
- }
- pShellMalloc->Release();
- }
- //創建自己的臨時目錄,如C:\Users\**\AppData\Roaming\veng\SysCheck\
- wcscat_s(TmpPath,_T("\\veng"));
- if(!PathFileExists(TmpPath))
- {
- CreateDirectory(TmpPath,NULL);
- }
- wcscat_s(TmpPath,_T("\\SysCheck"));
- if(!PathFileExists(TmpPath))
- {
- CreateDirectory(TmpPath,NULL);
- }
- wcscat_s(TmpPath,_T("\"));
- return TmpPath;
- }
- wstring VengFuncConfig::GetCommonAppDataPath(void)
- {
- wstring cRtValue;
- cRtValue = VengFuncConfig::ReadCfg(_T("Common AppData"),_T("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders"));
- cRtValue += _T("\\test");
- if(!PathFileExists(cRtValue.c_str()))
- {
- CreateDirectory(cRtValue.c_str(),NULL);
- }
- cRtValue += _T("\\SysCheck");
- if(!PathFileExists(cRtValue.c_str()))
- {
- CreateDirectory(cRtValue.c_str(),NULL);
- }
- cRtValue += _T("\\");
- return cRtValue;
- }