18,356
社区成员
发帖
与我相关
我的任务
分享
{
// TODO: Add your control notification handler code here
CStringA strHtml;
HttpTranslate(CHttpConnection::HTTP_VERB_POST,
_T("http://www.autumn-ink.com/BackupBoy/test.jsp"), _T("info=abc&var=15"), strHtml);
if(!strHtml.IsEmpty())
{
TRACE(_T("%s\n"), strHtml);
try
{
LPCTSTR szFile = _T("e:\\temp\\t.html");
CFile f(szFile, CFile::modeCreate|CFile::modeWrite);
f.Write((LPCSTR)strHtml, strHtml.GetLength());
f.Close();
ShellExecute(NULL, NULL, szFile, NULL, NULL, SW_SHOWNORMAL);
}
catch(CFileException *e)
{
e->ReportError();
e->Delete();
}
}
}
HINTERNET hSession = InternetOpenW(L"Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0);
HINTERNET hConnect = InternetConnectW(hSession, L"img4.imgtn.bdimg.com", (INTERNET_PORT)80 /*443*/, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 0);
HINTERNET hRequest = HttpOpenRequestW(hConnect, L"Post", L"it/u=3836676079,1858751875&fm=26&gp=0.jpg", NULL, NULL, NULL, 0 /*INTERNET_FLAG_SECURE*/, 0);
HttpSendRequest(hRequest, NULL, NULL, (LPVOID)"data=download", strlen("data=download"));