Results 1 to 2 of 2

Thread: Winsock to Check Webpage

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jul 1999
    Posts
    16

    Question

    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

    ShadowWalker
    webmaster of shadowkeep.com

  2. #2
    Guest
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width