|
vs2008 下的 wm 6 classis emulator
[复制链接]
- hSession = InternetOpen(szAgent, INTERNET_OPEN_TYPE_PRECONFIG,NULL,NULL,0);
- hConnect = InternetConnect(hSession, L"localhost", 80,NULL,NULL,INTERNET_SERVICE_HTTP,0,NULL);
-
- if( hSession==NULL || hConnect==NULL )
- {
- //给点提示
- MessageBox(NULL ,L"初始化Wininet失败!" ,L"警告" ,MB_OK);
- return ;
- }
- TCHAR strFormData[MAX_LOADSTRING];
- wsprintf(strFormData,L"userName=%s&password=%s&fromapp=1",L"admin",L"11111");
- TCHAR strTemp[MAX_LOADSTRING];
- wsprintf(strTemp, L"%s%s", L"/webdesk",L"/signon_check");
- const wchar_t* lplpszAcceptTypes[] = {L"*/*", NULL};
- HINTERNET hFile = HttpOpenRequest(hConnect,L"POST", strTemp, L"HTTP/1.1", NULL, lplpszAcceptTypes,INTERNET_FLAG_NO_CACHE_WRITE,NULL);
-
- if(!HttpSendRequest(hFile, szHeaders, MAX_LOADSTRING, (LPVOID)strFormData, MAX_LOADSTRING))
- {
- long err = GetLastError();
- MessageBox(NULL ,L"发送请求失败!" ,L"警告" ,MB_OK);
- }
复制代码
返回err = 12029错误,请高手指点!
仿真机已经联网
|
|