Results 1 to 13 of 13

Thread: winsock, help[solved]

Threaded View

  1. #1

    Thread Starter
    Member
    Join Date
    Apr 2005
    Posts
    61

    Resolved winsock, help[solved]

    when i press the button, it dont connect, nothing happen
    any idea?
    VB Code:
    1. Private Sub button_click()
    2. Dim hosty As Variant
    3. Dim sitey As Variant
    4. hosty = host.Text
    5. sitey = site.Text
    6. Winsock1.RemoteHost = hosty
    7. Winsock1.RemotePort = 80
    8. Winsock1.Connect
    9. End Sub
    10.  
    11.  
    12. Private Sub Winsock1_Connect()
    13. Dim strCommand As String
    14. Dim strWebPage As String
    15. strWebPage = sitey
    16. strCommand = "GET " + strWebPage + " HTTP/1.0" + vbCrLf
    17. strCommand = strCommand + "Accept: */*" + vbCrLf
    18. strCommand = strCommand + "Accept: text/html" + vbCrLf
    19. strCommand = strCommand + vbCrLf
    20. Winsock1.SendData strCommand
    21. End Sub
    22.  
    23. Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
    24. Dim webData As String
    25. Winsock1.GetData webData, vbString
    26. TxtWebPage.Text = TxtWebPage.Text + webData
    27. End Sub
    Last edited by rodrigorules; Apr 23rd, 2005 at 02:42 PM.

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