try{
CString strDescript = "提交成功完成!";
CString strUrl = "http://localhost:8081/pro/index.php/Home/Index/add";
CString strPara = "username=wangy&password=123456";
CString strServer, strObject, strHeader, strRet;
unsigned short nPort;
DWORD dwServiceType;
if(!AfxParseURL(strUrl, dwServiceType, strServer, strObject, nPort))
{
strDescript = strUrl + "不是有效有网络地址!";
AfxMessageBox(strDescript);
return;
}
CInternetSession sess;//Create session
CHttpFile* pFile;
CHttpConnection *pServer = sess.GetHttpConnection(strServer, nPort);
if(pServer == NULL)
{
strDescript = "对不起,连接服务器失败!";
AfxMessageBox(strDescript);
return;
}
pFile = pServer->Open
C++POST提交数据
最新推荐文章于 2021-10-24 16:24:20 发布