Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 637
  • Last Modified:

Read text File from a website into a vb.net win form

I am trying to read a text file into a scrolling label control in a vb.net win form.
The problem is i'm getting   URI not Supported
Code is
Dim fsStream As New FileStream("http://powerzsoftware.com/Nba/Grizzlies.txt", FileMode.Open, FileAccess.Read)
            Dim srReader As New StreamReader(fsStream)

            Try
                srReader.BaseStream.Seek(0, SeekOrigin.Begin)
                While srReader.Peek() > -1
                    Label6.Text = (srReader.ReadLine())
                End While
                srReader.Close()
            Catch ex As IOException
                Label6.Text = (ex.Message)
            End Try
0
powerztom
Asked:
powerztom
  • 2
1 Solution
 
CodeCruiserCommented:
Use the my.computer.network.downloadfile method to first download the file and then open it

http://msdn.microsoft.com/en-us/library/ack30t8y(v=vs.90).aspx
0
 
powerztomAuthor Commented:
Clever Idea Thank You.

powerzsoftware.net
Powerzsoftware.com
0
 
CodeCruiserCommented:
Can you explain that grade?
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now