1.

Solve : [VB.net] Open "page source" from URI in VB.net?

Answer»

I want to open the same text you get from right clicking in the background of your browser->view source and load it into a STRING.

The whole file is very short ATM so i am posting it all.

Code: [Select]Imports System
Imports System.IO

Module Module1

    Sub Main()
        Try
            ' CREATE an instance of StreamReader to read from Hulu.com
            Dim sr As StreamReader = New StreamReader("http://www.hulu.com/search?query=type%3Amovie")
            Dim line As String
            ' Read and display the LINES from the file until the end
            ' of the file is reached.
            Do
                line = sr.ReadLine()
                Console.WriteLine(line)
            Loop Until line Is Nothing
            sr.Close()
        Catch E As Exception
            ' Let the user know what went wrong.
            Console.WriteLine("The file could not be read:")
            Console.WriteLine(E.Message)
        End Try
        Console.Read()
    End Sub
End Module

Thanks in ADVANCE,
Liam



Discussion

No Comment Found