473,327 Members | 2,012 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

webclient using proxy?

Have a strange problem.
Creating a windows service running under the Local Sytem account.
I have a Webclient that downloads a file from the internet.
The code works fine if executed from a windows form but when i execute it in
a windows service i get the following error:
The proxy name could not be resolved: 'macc4'

'macc4' is a proxy server i have used in IE in the past at work, but why in
the world is the webclient trying to use this proxy server???

Can anyone shed some light on what might be going on?

Dim wc As New WebClient

Dim myCredentials As New NetworkCredential(http_user, http_passwd)

wc.Credentials = myCredentials

If File.Exists(local_dir & file_name) Then File.Delete(local_dir &
file_name)

wc.DownloadFile(URL & file_name, local_dir & file_name)

--
Regards,

nathan
Aug 27 '07 #1
3 3461
Sounds like the web service created a user profile to get internet
settings from, which would have been based off the default user profile.
Search the default profile in regedit for "macc4", and check the
"proxyenable" key to make sure it's a 0. Then, delete the "Local System"
profile on the hard drive, and rerun the service.
Steve C.
MCSD,MCAD,MCSE,MCP+I,CNE,CNA,CCNA
Nathan wrote:
Have a strange problem.
Creating a windows service running under the Local Sytem account.
I have a Webclient that downloads a file from the internet.
The code works fine if executed from a windows form but when i execute it in
a windows service i get the following error:
The proxy name could not be resolved: 'macc4'

'macc4' is a proxy server i have used in IE in the past at work, but why in
the world is the webclient trying to use this proxy server???

Can anyone shed some light on what might be going on?

Dim wc As New WebClient

Dim myCredentials As New NetworkCredential(http_user, http_passwd)

wc.Credentials = myCredentials

If File.Exists(local_dir & file_name) Then File.Delete(local_dir &
file_name)

wc.DownloadFile(URL & file_name, local_dir & file_name)
Aug 27 '07 #2
Nathan wrote:
Have a strange problem.
Creating a windows service running under the Local Sytem account.
I have a Webclient that downloads a file from the internet.
The code works fine if executed from a windows form but when i execute it in
a windows service i get the following error:
The proxy name could not be resolved: 'macc4'

'macc4' is a proxy server i have used in IE in the past at work, but why in
the world is the webclient trying to use this proxy server???

Can anyone shed some light on what might be going on?

Dim wc As New WebClient
We can't tell you why that particular proxy is used but .NET uses the IE
proxy settings.
Details are here:
<URL:http://msdn2.microsoft.com/en-us/library/fze2ytx2.aspx>

If you don't want to use a proxy then one way is by setting
wc.Proxy = GlobalProxySelection.GetEmptyWebProxy()
I think.

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Aug 27 '07 #3
Sweet! That did the trick. Thanx
"Steve" <ln********************@gmail.comwrote in message
news:uP**************@TK2MSFTNGP04.phx.gbl...
Sounds like the web service created a user profile to get internet
settings from, which would have been based off the default user profile.
Search the default profile in regedit for "macc4", and check the
"proxyenable" key to make sure it's a 0. Then, delete the "Local System"
profile on the hard drive, and rerun the service.
Steve C.
MCSD,MCAD,MCSE,MCP+I,CNE,CNA,CCNA
Nathan wrote:
>Have a strange problem.
Creating a windows service running under the Local Sytem account.
I have a Webclient that downloads a file from the internet.
The code works fine if executed from a windows form but when i execute it
in a windows service i get the following error:
The proxy name could not be resolved: 'macc4'

'macc4' is a proxy server i have used in IE in the past at work, but why
in the world is the webclient trying to use this proxy server???

Can anyone shed some light on what might be going on?

Dim wc As New WebClient

Dim myCredentials As New NetworkCredential(http_user, http_passwd)

wc.Credentials = myCredentials

If File.Exists(local_dir & file_name) Then File.Delete(local_dir &
file_name)

wc.DownloadFile(URL & file_name, local_dir & file_name)

Aug 28 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Gary Short | last post by:
Hello group, I was wondering if anyone here could help me with an odd WebClient problem. When I run the following code: WebClient aWebClient = new WebClient(); Byte aBA =...
4
by: Morten Snedker | last post by:
I'm trying to download a file. I've tried both using webclient and the httpWebRequest. Either way it returns a "407 proxy authentication required". The program is to be run externally, so...
2
by: kkb | last post by:
Hello! First, I'm sorry because of my english... I'll try to be understandable! I've got a strange problem using .NET 2003 C# and I haven't figured it out for a long time. I'm implementing an...
2
by: TheMaxx | last post by:
I try getting response from web site through proxy in my domain: WebClient wc = new WebClient(); WebProxy wProxy = new WebProxy(); CredentialCache cc = new CredentialCache();...
1
by: Mad Scientist Jr | last post by:
For some reason I can't get a WebClient to access an outside URL from behind our firewall. The code works when it runs outside the firewall. I turned on windows authentication in the web.config...
1
by: Mike | last post by:
I am using PowerShell to download an XML file into a string using the DownloadString(URI) method of System.Net.WebClient object. Sample commands below: $Result = $Null; $WebClient = new-object...
4
by: Harvey Triana | last post by:
Hi- I am using... WebClient Client = new WebClient (); Client.DownloadFile(url, filename); Or Stream strm = Client.OpenRead (url);
1
by: Jules Winfield | last post by:
I've build a client-server application in which the client communicates with the server by making calls to WebClient.UploadValuesAsync(). In a given client session, hundreds of calls will be made...
0
by: malkin | last post by:
Hi all, I have an external application that calls WebClient to download a file from our server. It runs fine without any proxy server involved. However, once there is a proxy server layer, it...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.