
12-09-2005, 04:57 PM
|
|
Freshman
|
|
Join Date: Oct 2004
Posts: 32
|
|
Basic Winsock Help
|
Ok. I am making a wrapper in Winsock. I am new to winsock, after using iNet and Webbrowser in the past... and I have some problems. I have managed to get so far currently by myself... (not far :P) All I have currently done is enable winsock to go to a page.
My Problem:
I am returning the function as a string. So when a user users the control, I want the returned result to be the source of the page. I was wondering how I get it?
Current Code:
Code:
Public Function GetPage(ByVal URL As String, Optional ByVal Refferer As String) As String
Dim strHost As String
If URL = Empty Then
Exit Function
End If
If LCase$(Left$(URL, 7)) = "http://" Then
strHost = Mid$(URL, 8)
Else
strHost = URL
End If
If InStr(1, strHost, "/") Then
strHost = Left$(strHost, InStr(1, strHost, "/") - 1)
End If
Winsock1.RemoteHost = strHost
Winsock1.RemotePort = 80
Winsock1.LocalPort = 0
Winsock1.Connect
Do Until Winsock1.State = 7: DoEvents: Loop
End Function
Help appreciated...
Thanks,
xcannon
|
|