LoadWebPages




Winsock1.RemoteHost = "jelsoft.com"
Winsock1.RemotePort = 80
Winsock1.Connect

'Nell'evento Winsock1.Connect mettete il seguente codice per

'scaricare la pagina web.


Dim strCommand as String
Dim strWebPage as String

strWebPage = "http://www.jelsoft.com/index.html"
strCommand = "GET " + strWebPage + " HTTP/1.0" + vbCrLf
strCommand = strCommand + "Accept: */*" + vbCrLf
strCommand = strCommand + "Accept: text/html" + vbCrLf
strCommand = strCommand + vbCrLf

Winsock1.SendData strCommand

'Il controllo Winsock tentera' di scaricare la pagina.

'Quando ricevera' dei dati dal server attivera' l'evento

'DataArrival.


Dim webData As String
Winsock1.GetData webData, vbString
TxtWebPage.Text = TxtWebPage.Text + webData
Dovete innanzitutto avere il controllo Winsock caricato nel
progetto. Questo codice assume che il controllo sia chiamato
Winsock1. Deve esserci anche una text box nella maschera che
e' chiamata txtWebPage.
Ci colleghiamo al computer remoto usando il seguente codice:










( loadwebpages.html )- by Paolo Puglisi - Modifica del 17/12/2023