Visual Basic.NET - Leer desde VB.NET el código fuente de una pág HTML

 
Vista:

Leer desde VB.NET el código fuente de una pág HTML

Publicado por Mark Ibañez (1 intervención) el 23/02/2005 19:10:10
Hola, quisiera saber si es posible leer de alguna manera el código fuente de un archivo HTML, muchas gracias
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:Leer desde VB.NET el código fuente de una pág H

Publicado por batilo (49 intervenciones) el 02/03/2005 14:04:41
Dim sURL As String
sURL = "http://www.google.es/"

Dim wrGETURL As WebRequest
wrGETURL = WebRequest.Create(sURL)

'Dim myProxy As New WebProxy("myproxy", 80)
'myProxy.BypassProxyOnLocal = True

'wrGETURL.Proxy = myProxy
wrGETURL.Proxy = WebProxy.GetDefaultProxy()

Dim objStream As Stream
objStream = wrGETURL.GetResponse.GetResponseStream()

Dim objReader As New StreamReader(objStream)
Dim sLine As String = ""
Dim i As Integer = 0

Do While Not sLine Is Nothing
i += 1
sLine = objReader.ReadLine
MsgBox(sLine)
If Not sLine Is Nothing Then
Console.WriteLine("{0}:{1}", i, sLine)
End If
Loop

Console.ReadLine()
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar