Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Upload txt file from website

Status
Not open for further replies.

sicohne

Technical User
Jun 30, 2003
51
GB
I am trying to write a program that will automatically grab a txt file from a website but can't figure out how to code it. Any help?

Short & sweet and (hopefully) nice & simple.

Thanks
 
Are you trying to grab the text of the web site? A text file on the web server? A text file that's included as part of the web page? "a txt file from a website" isn't specific enough to answer your question.
 
Look up HTTPWebRequest and HTTPWebResponse in Help for an example.

Craig
 
Thanks Craig for point me in the write direction there. Now I have a new (related) problem.
The following code....
-------
Dim proxyObject As WebProxy = New WebProxy(ProxyAddress)
GlobalProxySelection.Select = proxyObject
Dim myClient As WebClient = New WebClient
myClient.Credentials = New NetworkCredential(UserName, Password)
myClient.DownloadFile(" "G:\My documents\bbb.txt")
--------
brings up the following error:
"The underlying connection was closed: Unable to connect to the remote server.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top