No equivalent class in VC. but you can do it in this way:
construct an CInternetSession object, and then call CInternetSession::GetHttpConnection to get an CHttpConnection object, then call CHttpConnection::OpenRequest to open the URL.
construct an CInternetSession object, and then call CInternetSession::GetHttpConnection to get an CHttpConnection object, then call CHttpConnection::OpenRequest to open the URL.
解决方案 »
- BitBlt如何实现
- 大家都进来谈谈vc中的正则表达式吧
- 关于PING的原代码
- 怎样取得MSDN中左边那个看似是ListBox但实际上不是的那个控件的某一项内容?
- 如何编程得到子网掩码和修改子网掩码
- 连接问题:LINK : fatal error LNK1104: cannot open file "XXX.lib"
- 如何将row[1]的字符串转换成 access里的类型 货币 类型???
- 我的程序无法找到入口,怎么办?回答就给分!
- 怎样将界面上的多个button的长和宽设置成一样的?
- 急!!在线等待:如何得到弹出的对话框的位置和大小??
- 怎么取得一个CHAR型字符串前N个字符?
- 一段数据从内存一个地方考到另一个地方(原来的数据可以不要)memcpy, memmove哪个执行速度快
CHttpConnection* pServer = NULL;
CHttpFile* pFile = NULL;
CString ServerName = "webmail.21cn.com";
INTERNET_PORT nPort = 80;
DWORD retcode;
char outBuff[300] = "LoginName=aaa&passwd=xxx&DomainName=21cn.com";//I have test this with my loginname and password
try
{
pServer = session.GetHttpConnection(ServerName,nPort);
pFile = pServer->OpenRequest(CHttpConnection::HTTP_VERB_POST,"/NULL/NULL/NULL/NULL/NULL/SignIn.gen",NULL,1,NULL,NULL,INTERNET_FLAG_EXISTING_CONNECT);
pFile -> AddRequestHeaders("Content-Type: application/x-www-form-urlencoded");
pFile -> AddRequestHeaders("Accept: */*");
pFile -> SendRequest(NULL,0,outBuff,strlen(outBuff)+1);
pFile -> QueryInfoStatusCode(retcode);
// you can read from the file after this......I've just left it out.
for(int i=0;i<10;i++)//read ten line of returned HTML,you need to edit this to use the result
{
CString smsg;
pFile->ReadString(smsg);
AfxMessageBox(smsg);
}
DWORD dwlen=pFile->GetLength();
char buf[1024];
DWORD dwread=pFile->Read(buf,1024);
}
catch (CInternetException * e){};
delete pFile;
delete pServer;
session.Close();