分类: C/C++
2009-05-31 11:14:22
CString strHeaders =_T("Content-Type: application/x-www-form-urlencoded\r\n"); CInternetSession session; CHttpConnection* pConnection =session.GetHttpConnection("127.0.0.1",(INTERNET_PORT)80); CHttpFile* pFile =pConnection->OpenRequest(CHttpConnection::HTTP_VERB_POST,"1.php"); BOOL result = pFile->SendRequest(strHeaders,"sid=1",5); pFile->Close(); pConnection->Close(); delete pFile; delete pConnection; session.Close();
在 BOOL result = pFile->SendRequest(strHeaders,"sid=1",5);中
"sid = 1"就是你向网页提交的参数,5是参数的长度