SHFILEOPSTRUCT FileOp;
ZeroMemory((void*)&FileOp,sizeof(SHFILEOPSTRUCT));
FileOp.fFlags = FOF_NOCONFIRMATION ;
FileOp.hNameMappings = NULL;
FileOp.hwnd = NULL;
FileOp.lpszProgressTitle = NULL;
FileOp.pFrom = oldBuf;//源地址
FileOp.pTo = newBuf;//目的地址
FileOp.wFunc = FO_MOVE;
int ret = SHFileOperation(&FileOp);
if(0==ret)
{
AfxMessageBox(_T("上传成功"));
}
注意:两个地址最后两个字节必须为\0
oldBuf[oldPath.size()]='\0';
oldBuf[oldPath.size()+1]='\0';
newBuf[newPath.size()]='\0';
newBuf[newPath.size()+1]='\0';


 




长风破浪会有时,直挂云帆济沧海!