VS C++ 中如何修改文件名称

忘了在哪看到的, 代码如下:

std::wstring newFilename = tempFileName.c_str();
newFilename += _T("new.txt");
if (!MoveFileEx(tempFileName.c_str(), newFilename.c_str(), flags )) {
    //error handling if call fails
}

猜你喜欢

转载自blog.csdn.net/ftell/article/details/80481166
今日推荐