PDA

Click to See Complete Forum and Search --> : Winsock to Check Webpage


ShadowWal
Aug 8th, 2000, 02:30 AM
greetings, i have been using inet to Try to check the status of webpages. it works up to when a timeout happens then the rest of the links are auto set to DNS. i have tryed to use winsock to download the page, but my program doesnt give it enofe time to download the data before going to the next item on the list. i have tryed to use sleep, a do while, and nothing has helped..thanks for any help

code:
For i = 1 To lvAcc.ListItems.Count
rtbBody.Text = "": rtbHeader.Text = ""
ListBody.Clear: ListHeader.Clear
Set lvAcc.SelectedItem = lvAcc.ListItems(i)

Dim a
a = Split(lvAcc.ListItems(i).SubItems(1), "/", 4)
MsgBox a(2)
Winsock1.RemoteHost = "" & a(2) & ""
Winsock1.RemotePort = 80
Winsock1.Connect
...' more here to add the Return Code
next i

Winsock.connect
Dim strCommand As String
Dim strWebPage As String
strWebPage = lvAcc.ListItems(i).SubItems(1)
MsgBox strWebPage
strCommand = "GET " + strWebPage + " HTTP/1.0" + vbCrLf
strCommand = strCommand + "Accept: */*" + vbCrLf
strCommand = strCommand + "Accept: text/html" + vbCrLf
strCommand = strCommand + vbCrLf
Winsock1.SendData strCommand

winsock.data_arrival
Dim webData As String
Winsock1.GetData webData, vbString
RichTextBox1.Text = RichTextBox1.Text + webData

Aug 9th, 2000, 06:28 AM
I'd use the Internet Transfere Control and a loop that checks the ".StillExecuting" property to see if the program should progress to the next file of code or wait.

I'd also suggest that you get the Internet Transfere Control out of Service Pack 4 as the previous versions have some bug that stops them from properly downloading the full file every time.

I'll send you a copy of the updated control if you want.