能力值:
( LV3,RANK:30 )
|
-
-
2 楼
Google -> "WinHTTP"
|
能力值:
( LV2,RANK:10 )
|
-
-
3 楼
那个兄弟可以把winhttp.inc和lib打个包给我?不想去下PlatformSDK太大了啊。。。谢谢
|
能力值:
( LV2,RANK:10 )
|
-
-
4 楼
先用wininet试了下
mov uc.dwStructSize,sizeof uc
lea eax,host
mov uc.lpszHostName,eax
mov uc.dwHostNameLength,sizeof host
lea eax,path
mov uc.lpszUrlPath,eax
mov uc.dwUrlPathLength,sizeof path
lea eax,extra
mov uc.lpszExtraInfo,eax
mov uc.dwExtraInfoLength,sizeof extra
invoke InternetCrackUrl,addr Url, 0, ICU_ESCAPE, addr uc
invoke InternetOpen,CTXT("TEST"),INTERNET_OPEN_TYPE_PRECONFIG,NULL,NULL,0
mov hSession,eax
invoke gethostbyname,addr host
mov eax,[eax+12]
mov eax,[eax]
mov eax,[eax]
invoke inet_ntoa,eax
invoke InternetConnect,hSession,eax, addr uc.nPort, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 0
mov hConnect,eax
mov flags,0
invoke HttpOpenRequest,hConnect,CTXT("POST"), addr path, NULL, NULL, NULL, flags, 0
mov hRequest,eax
invoke lstrlen,addr strHeader
invoke HttpAddRequestHeaders,hRequest,addr strHeader, eax, HTTP_ADDREQ_FLAG_ADD
invoke lstrlen,addr strPostData
invoke HttpSendRequest,hRequest, 0, 0,addr strPostData, eax
现在就是一到 HttpSendRequest 就无响应了,(好像很久才有反应)前面都正常,谁能说说是怎么回事?
|
能力值:
( LV9,RANK:380 )
|
-
-
5 楼
自己构造http包 然后send吧
|
能力值:
( LV2,RANK:10 )
|
-
-
6 楼
你的意思难道是这种方式不行?
|
能力值:
( LV9,RANK:220 )
|
-
-
7 楼
; Post Data to URL
proc PostData lpszHeader, szMethod, lpszFromData, szHostName, szFormAction
pushad
i InternetOpen, esi, esi, esi, esi, esi = 0
test eax, eax
je .OverSession
xchg eax, ebx ;ebx = hSession
i InternetConnect, ebx, [szHostName], INTERNET_DEFAULT_HTTP_PORT, esi, esi, INTERNET_SERVICE_HTTP, esi, esi
xchg eax, edi
test edi, edi
je .Over ;edi = hConnect
i HttpOpenRequest, edi, [szMethod], [szFormAction], 'HTTP/1.1', esi, esi, esi, esi
test eax, eax
je .Over
xchg eax, esi
i lstrlen, [lpszFromData]
i HttpSendRequest, esi, [lpszHeader], -1, [lpszFromData], eax
.Over:
i InternetCloseHandle, edi
.OverSession:
i InternetCloseHandle, ebx
popad
ret
endp
|
能力值:
( LV2,RANK:10 )
|
-
-
8 楼
自己解决了,还是我那个代码不过有个地方写错了改成这样就可以了
invoke InternetOpen,CTXT("Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"),INTERNET_OPEN_TYPE_PRECONFIG,NULL,INTERNET_INVALID_PORT_NUMBER,0
mov hSession,eax
invoke InternetConnect,hSession,addr host, INTERNET_INVALID_PORT_NUMBER, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 0
mov hConnect,eax
mov flags,0
invoke HttpOpenRequest,hConnect,CTXT("POST"), addr fpath, NULL, NULL, NULL, flags, 0
mov hRequest,eax
lea ebx,strHeader
$ahloop:
invoke lstrlen,ebx
invoke HttpAddRequestHeaders,hRequest,ebx, eax, HTTP_ADDREQ_FLAG_ADD
.if eax
invoke lstrlen,ebx
add ebx,eax
inc ebx
jmp $ahloop
.endif
invoke lstrlen,addr strPostData
invoke HttpSendRequest,hRequest, 0, 0,addr strPostData, eax
invoke MessageBox,NULL,CTXT("test"),NULL,MB_OK
|
能力值:
( LV13,RANK:420 )
|
-
-
9 楼
我的精华文章里面有关于这个的
(*^__^*) 嘻嘻……
|