Question Read text file in localhost

LeonLanford

Active member
Joined
Dec 2, 2008
Messages
28
Programming Experience
Beginner
Hi.. I really need help :(
I want to read file from http://localhost/tes/view.txt

but it got stuck at this code
VB.NET:
Dim objReader As New StreamReader("http://localhost/tes/view.txt")

It said URI format not supported.. How to make it support? Is there some way to read remote file text?

Thanks..
 
I don't have anything handy to test with but this should be close.

VB.NET:
Dim wc As New Net.WebClient
Dim fileContents As String = wc.DownloadString(address)
 
I don't have anything handy to test with but this should be close.

VB.NET:
Dim wc As New Net.WebClient
Dim fileContents As String = wc.DownloadString(address)

thanks.. :D
i haven't tested you code, now i'm using openread to read the text file :D
 
Back
Top