rt
解决方案 »
- CHtmlView類怎實現後台模擬鼠標?
- 用VC实现对数据库记录集查询
- 跪求MFC解决图像块状切割与重组的问题!
- 请问怎么读取16进制报文??
- WNDCLASS类中的lpszClassName是什么作用?
- 在VC中如何向.EXE文件传入参数
- 有关GINA的几个严重问题!!!急
- 抓屏
- 使用vc编译器调试多线程程序,如何在某一特定线程中的特定变量发生变化时,使调试停下来。(不使用f10)
- CWindow::func() 和CWnd::func()有什么不同?不都是窗口类的函数吗?
- 无法锁定DIRECTDRAW表面,每次调用完lpsurface->Lock(NULL,&DDdesc,DDLOCK_WAIT,NULL)总是返回失败!=DD_OK
- 已知一个IShellFolder,怎么得到这个文件夹的 路径
void CDlgRptTest::OnBnClickedButtonTest()
{
CString strRemotePath = "D:\\Wdj";
CString strRemoteFile = "";
CString strLocalPath = "D:\\";
CString strLocalFileName = "话务报告测试.txt"; CInternetSession sess(_T("RptAlyCfg"));
CFtpConnection* pFtpConnect = NULL;
try
{
CString strIPAddr = "192.168.11.11";
CString strFtpUser = "Administrator";
CString strFtpPwd = "123456"; pFtpConnect = sess.GetFtpConnection(strIPAddr, strFtpUser, strFtpPwd, 21);
if(NULL == pFtpConnect)
{
CMessage::ShowErrorMsg("连接服务器失败,上传话务报告文件失败!");
return;
}
pFtpConnect->SetCurrentDirectory(strRemotePath); pFtpConnect->PutFile(strLocalFileName,
strRemotePath + strRemoteFile,
FTP_TRANSFER_TYPE_BINARY,
TRUE);
}
catch (CInternetException* pEx)
{
TCHAR sz[1024];
pEx->GetErrorMessage(sz, 1024);
CMessage::ShowErrorMsg(sz);
pEx->Delete();
return;
}
catch(...)
{
CMessage::ShowErrorMsg("未知错误,上传失败!");
return;
} if (pFtpConnect != NULL)
{
pFtpConnect->Close();
}
delete pFtpConnect; CMessage::ShowPromptMsg(_T("成功上传话务测试报告:\n\n%s"), strLocalFileName);
}