Accessing a Web File

DekaFlash

Well-known member
Joined
Feb 14, 2006
Messages
117
Programming Experience
1-3
Can uriWebsite point to a password protected area, for example a htaccess protected area.


Dim
uriWebsite AsNew Uri("http://www.mywebsite.com/testfile.txt")
Dim WReq As WebRequest = WebRequest.Create(uriWebsite)
Dim wResp As WebResponse = WReq.GetResponse()
Dim sr AsNew StreamReader(wResp.GetResponseStream(), Encoding.ASCII)
Dim aTokens() AsString
Dim Tokens AsInteger = 0
Dim LoopCount AsInteger = 0
MsgBox(wResp.ContentLength.ToString)
For LoopCount = 0 To wResp.ContentLength
3166 - aTokens = sr.ReadLine().Split(",")
Tokens += 1
Next
MsgBox(Tokens.ToString)

 
Last edited:
Back
Top