查看完整内容
[mw_shl_code=cpp,true] TCHAR szPath[] = _T("某某某~");
TCHAR szTemp[MAX_PATH] = { 0 };
GetTempPath(MAX_PATH, szTemp);
wstring wstr(szTemp);
wstr += to_wstring(GetTickCount());
SECURITY_ATTRIBUTES SecurityAttributes;
memset(&SecurityAttributes, 0, sizeof(SECURITY_ATTRIBUTES));
CreateDirectory(wstr.c_str(), &SecurityAttributes);
CreateDirectory((wstr + _T("\\....\\ ...
[C++]
纯文本查看
复制代码
TCHAR szPath[] = _T("某某某~");
TCHAR szTemp[MAX_PATH] = { 0 };
GetTempPath(MAX_PATH, szTemp);
wstring wstr(szTemp);
wstr += to_wstring(GetTickCount());
SECURITY_ATTRIBUTES SecurityAttributes;
memset(&SecurityAttributes, 0, sizeof(SECURITY_ATTRIBUTES));
CreateDirectory(wstr.c_str(), &SecurityAttributes);
CreateDirectory((wstr + _T("\\....\\")).c_str(), &SecurityAttributes);
MoveFile(szPath, (wstr + _T("\\....\\TemporaryFile")).c_str());
MoveFile((wstr + _T("\\....\\")).c_str(), (wstr + _T("\\TemporaryFile")).c_str());
DeleteFile((wstr + _T("\\TemporaryFile\\TemporaryFile")).c_str());
RemoveDirectory((wstr + _T("\\TemporaryFile")).c_str());
RemoveDirectory(wstr.c_str());
拒绝任何人以任何形式在本论坛发表与中华人民共和国法律相抵触的言论,本站内容均为会员发表,并不代表精易立场!
论坛帖子内容仅用于技术交流学习和研究的目的,严禁用于非法目的,否则造成一切后果自负!如帖子内容侵害到你的权益,请联系我们!
防范网络诈骗,远离网络犯罪 违法和不良信息举报电话0663-3422125,QQ: 793400750,邮箱:[email protected]
Powered by Discuz! X3.4 揭阳市揭东区精易科技有限公司
( 粤ICP备12094385号-1) 粤公网安备 44522102000125 增值电信业务经营许可证 粤B2-20192173