
Originally Posted by
zero_cool
what does battleon have to do with "gangsta wars"
LOL! Okay, seeing as that you have no clue what the program you just posted does, and you obviously didn't write it, the rest of this post will be to whoever actually did write these.
You're using Inet in Visual Basic 6, which uses Internet Explorer cookies, is slightly slower than winsock, and seeing as that you have no clue what you're doing, you don't even properly obtain the page. You're also using Inet.OpenURL which doesn't even allow you to POST any data or set a proper Referer, and the rest of your headers are way off.
Here's a much more proper way of using Inet, using the Execute function.
Code:
Do While Inet1.StillExecuting: DoEvents: Loop
txthtml1.Text = Empty
Inet1.Execute "http://www.google.com/index.html", "GET", , "Referer: http://www.mpgh.net/forum/" & vbCrLf & "Content-Type: application/x-www-form-urlencoded" & vbCrLf & "Accept-Language: en-us" & vbCrLf & "User-Agent: Mozilla/4.0 (compatiable; MSIE 6.0; Windows NT 5.1; yie6; www.ASPSimply.com; .NET CLR 1.0.3705)"
Do Until txthtml1.Text <> Empty: DoEvents: Loop
You obviously need a textbox named 'txthtml1' to hold the contents of the returned string. Of course that wouldn't make much sense without actually writing anything to txthtml1 now would it? You'd need this StateChanged sub.
Code:
Private Sub Inet1_StateChanged(ByVal State As Integer)
Dim HTML1
If State = 12 Then
HTML1 = Inet1.GetChunk(1024)
txthtml1.Text = HTML1
Do Until HTML1 = Empty
HTML1 = Inet1.GetChunk(1024)
txthtml1.Text = txthtml1.Text & HTML1
Loop
ElseIf State = icTimeout Then
Inet1.Cancel
End If
End Sub
Or of course on the timeout you could have it retry the execution depending on it's importance. I still advise you using winsock or curl.