Wednesday, December 15, 2010

VB.NET Read from TEXT File

 Dim FILENAME As String = "c:\IP.txt"

        Dim objStreamReader As StreamReader
        objStreamReader = File.OpenText(FILENAME)
        Dim contents As String = objStreamReader.ReadToEnd()
        Button1.Text = contents
        objStreamReader.Close()

No comments: