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!

what's wrong with my code?

Status
Not open for further replies.

sicohne

Technical User
Jun 30, 2003
51
GB
I need to grab a text file stored on a website. This is my code:
Code:
InvValue = "[URL unfurl="true"]http://jumpgate.mightygames.com/database/inventory/inventory.txt"[/URL]
Username = "Username"
Password = "Pswd"
myWebRequest = WebRequest.Create(InvValue)
myProxy = CType(myWebRequest.Proxy, WebProxy)
myProxy.Credentials = New NetworkCredential(Username, Password) [COLOR=green]'Proxy details[/color]
myStream = myClient.OpenRead(InvValue)
This works with a windows form but not a web form. What am I doing wrong?
 
What does the error message say?
BTW: I just copied the link into my browser and the page opened right up. no password prompts or anything.
maybe you don't need the NetworkCredentials.

Jason Meckley
Database Analyst
WITF
 
The web page is fine, it just that I have to access it through a proxy (which is where the NetworkCredentials bit comes in). The error message claims that the underlying network connection could not be established, which basically means that it is not passing my proxy details to the browser.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top