1,VB如何使用 Inet1 控件将 http://kf.hdfybjy.com/zxyy/new_add.php 的验证图片 放到Picture1(100分)
2,如何使用 Inet1 确定提交(100分)
Private Sub Command1_Click()
If Inet1.StillExecuting Then Exit Sub
'获取验证图片 Inet1.Execute "http://passport.csdn.net/ShowExPwd.aspx?temp=", "GET" 可以正常加载到picture中
Inet1.Execute "http://passport.csdn.net/ShowExPwd.aspx?temp=", "GET"
'而下句就报错:无效图片。
' Inet1.Execute "http://kf.hdfybjy.com/pic", "GET"
'上面两个http地址在IE中都可以看到图片为什么下一句不行啊?
End Sub
Private Sub Inet1_StateChanged(ByVal State As Integer)
If State = icResponseCompleted Then
Dim BinBuff() As Byte
Dim StrPath As String
StrPath = App.Path & "\" & "vcode.jpg"
BinBuff = Inet1.GetChunk(0, icByteArray)
If Dir(StrPath) <> "" Then Kill StrPath
Open StrPath For Binary As #1
Put #1, , BinBuff
Close #1
Picture1.Picture = LoadPicture(StrPath)
End If
End Sub