Go Back   Access World Forums > Apps and Windows > VB.NET

Thread Tools Rate Thread Display Modes
Old 11-11-2008, 03:18 AM   #1
Registered User
Join Date: Sep 2006
Posts: 31
Thanks: 0
Thanked 1 Time in 1 Post
Russ9517 is an unknown quantity at this point
Question Using Webproxy problem

I'm trying to save a xml website using webproxy and webclient but i can't get the code to work. As far as i can tell for the websites i've seen the code below should work but i'm getting error 404 file not found on the final command. My network requires you to use a proxy so i need to use a webproxy
Any ideas?

Dim myWebRequest As HttpWebRequest = CType(WebRequest.Create("http://www.currencysource.com"), HttpWebRequest)
Dim myProxy As New WebProxy
myProxy = CType(myWebRequest.Proxy, WebProxy)
Dim proxyAddress As String
proxyAddress = "http://proxy.uk.corporg.net/pacs/proxy.pac"
Dim username As String
Dim password As String
username = "russell.flynn"
password = "Rf011108"
Dim newUri As New Uri(proxyAddress)
myProxy.Address = newUri
myProxy.Credentials = New NetworkCredential(username, password)
myWebRequest.Proxy = myProxy
Dim myWebResponse As HttpWebResponse = CType(myWebRequest.GetResponse(), HttpWebResponse)

Dim web As New System.Net.WebClient
Dim strURL = "http://www.currencysource.com/rss/GBP.xml"
Dim strFileName = "C:\GBP.xml"
web.DownloadFile(strURL, strFileName)

Russ9517 is offline   Reply With Quote
Old 11-11-2008, 05:12 AM   #2
Registered User
Join Date: Mar 2001
Location: UK
Posts: 42
Thanks: 0
Thanked 1 Time in 1 Post
HiArt is on a distinguished road
Re: Using Webproxy problem

Dude, is it a good idea to post your username and password?

Cant help with proxies, hate the damned thing.

Does it work if you try this on another network (can you sneak some code home to try for example)? The proxy may be a red herring.
HiArt is offline   Reply With Quote

proxy , vb.net , webclient , webproxy

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Check-in/Check-out problem and afterupdate problem AccessInitiate Forms 2 04-09-2009 05:43 AM
Text wrap problem neilwebber Reports 0 04-30-2008 04:24 AM
network image print report problem Davros Forms 7 02-27-2008 12:02 AM
[SOLVED] conversion problem marc01 General 1 01-01-2007 03:58 AM
Math Problem.. mission2java_78 General 3 08-28-2002 10:24 AM

All times are GMT -8. The time now is 12:52 PM.

Microsoft Access Help
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post

Sponsored Links

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World