如题,小弟在做一个小东西,其中要xmlhttp模拟post请求一个远程地址的 验证码图片,请求完了,如何将二进制流转为正常的图片呢?
我给出验证码的地址吧,https://ssl.captcha.qq.com/getimage?aid=2001601&0.5978519566745728
现在要实现的就是
asp中模拟请求这个地址,并将图片还原为验证码图片,有没有能办到的?急求。 一定要模拟请求,然后将respons转为图片!求救啊
我给出验证码的地址吧,https://ssl.captcha.qq.com/getimage?aid=2001601&0.5978519566745728
现在要实现的就是
asp中模拟请求这个地址,并将图片还原为验证码图片,有没有能办到的?急求。 一定要模拟请求,然后将respons转为图片!求救啊
Dim arr() As Byte
With CreateObject("Msxml2.XMLHTTP.6.0")
.Open "GET", "https://ssl.captcha.qq.com/getimage?aid=2001601&0.5978519566745728", False
.Send
Do While .readyState <> 4
DoEvents
Loop
arr = .responseBody
Open "c:\1.tif" For Binary As #1
For i = 0 To UBound(arr)
Put #1, i + 1, arr(i)
Next i
Close #1
End With
End Sub
Private Sub Command2_Click() ' POST下载图片
Dim arr() As Byte
With CreateObject("Msxml2.XMLHTTP.6.0")
.Open "POST", "https://ssl.captcha.qq.com/getimage?aid=2001601&0.5978519566745728", False
.Send
Do While .readyState <> 4
DoEvents
Loop
arr = .responseBody
Open "c:\2.tif" For Binary As #1
For i = 0 To UBound(arr)
Put #1, i + 1, arr(i)
Next i
Close #1
End With
End Sub