473,804 Members | 3,425 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Weclient class and proxies

My code below works fine when I am no using web proxy:
//login and pwd is for the remote server.
NetworkCredenti al netCredential = new NetworkCredenti al(login,pwd);
WebClient client = new WebClient();
client.Credenti als = netCredential;
Console.WriteLi ne(client.Downl oadString(Reque stUrl));

However, when I run behind a proxy I get an exception that I need to
authenticate to the proxy.

How would I do this in my program? I read in the doc the WebClient by
default uses IE proxy settings? Is that true?

Thanks,

-Jalil
Oct 31 '08 #1
3 2577


http://msdn.microsoft.com/en-us/libr...xy(VS.80).aspx

?
"Jalil" <Ja***@discussi ons.microsoft.c omwrote in message
news:D6******** *************** ***********@mic rosoft.com...
My code below works fine when I am no using web proxy:
//login and pwd is for the remote server.
NetworkCredenti al netCredential = new NetworkCredenti al(login,pwd);
WebClient client = new WebClient();
client.Credenti als = netCredential;
Console.WriteLi ne(client.Downl oadString(Reque stUrl));

However, when I run behind a proxy I get an exception that I need to
authenticate to the proxy.

How would I do this in my program? I read in the doc the WebClient by
default uses IE proxy settings? Is that true?

Thanks,

-Jalil

Oct 31 '08 #2
Sloan,

Yes, I had seen this info before. It says:

The Proxy property identifies the IWebProxy instance that communicates with
remote servers on behalf of this WebClient object. The proxy is set by the
system using configuration files and the Internet Explorer Local Area Network
settings. To specify that no proxy should be used, set the Proxy property to
the proxy instance returned by the GetEmptyWebProx y method.

But how would I set this property to the what IE is configured to use?

Thanks,

-Jalil
"sloan" wrote:
>

http://msdn.microsoft.com/en-us/libr...xy(VS.80).aspx

?
"Jalil" <Ja***@discussi ons.microsoft.c omwrote in message
news:D6******** *************** ***********@mic rosoft.com...
My code below works fine when I am no using web proxy:
//login and pwd is for the remote server.
NetworkCredenti al netCredential = new NetworkCredenti al(login,pwd);
WebClient client = new WebClient();
client.Credenti als = netCredential;
Console.WriteLi ne(client.Downl oadString(Reque stUrl));

However, when I run behind a proxy I get an exception that I need to
authenticate to the proxy.

How would I do this in my program? I read in the doc the WebClient by
default uses IE proxy settings? Is that true?

Thanks,

-Jalil


Nov 1 '08 #3
Did you look at the sample code?

// Obtain the 'Proxy' of the Default browser.
IWebProxy proxy = myWebRequest.Pr oxy;
http://msdn.microsoft.com/en-us/libr...est.proxy.aspx


"Jalil" <Ja***@discussi ons.microsoft.c omwrote in message
news:4F******** *************** ***********@mic rosoft.com...
Sloan,

Yes, I had seen this info before. It says:

The Proxy property identifies the IWebProxy instance that communicates
with
remote servers on behalf of this WebClient object. The proxy is set by the
system using configuration files and the Internet Explorer Local Area
Network
settings. To specify that no proxy should be used, set the Proxy property
to
the proxy instance returned by the GetEmptyWebProx y method.

But how would I set this property to the what IE is configured to use?

Thanks,

-Jalil
"sloan" wrote:
>>

http://msdn.microsoft.com/en-us/libr...xy(VS.80).aspx

?
"Jalil" <Ja***@discussi ons.microsoft.c omwrote in message
news:D6******* *************** ************@mi crosoft.com...
My code below works fine when I am no using web proxy:
//login and pwd is for the remote server.
NetworkCredenti al netCredential = new NetworkCredenti al(login,pwd);
WebClient client = new WebClient();
client.Credenti als = netCredential;
Console.WriteLi ne(client.Downl oadString(Reque stUrl));

However, when I run behind a proxy I get an exception that I need to
authenticate to the proxy.

How would I do this in my program? I read in the doc the WebClient by
default uses IE proxy settings? Is that true?

Thanks,

-Jalil



Nov 3 '08 #4

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

Similar topics

0
1233
by: Alan Kennedy | last post by:
Greetings all, A few months ago I said I'd put together a page listing all of the python HTTP proxies that I knew of. And now the time has come..... http://xhaus.com/alan/python/proxies.html I'll be keeping that page up to date as much as I can, so please feel free to contact me with updates, corrections, etc.
10
2414
by: Clive Backham | last post by:
I tried posting this on comp.infosystems.www.misc, but that group appears to get very little traffic. So now I'm trying here. If there is a more appropriate group, please let me know. I'm interested in how cacheing web proxies are expected to behave with regard to pages that change. After changing the content of a simple web site I have, I discovered that the cacheing web proxies at at least one ISP I have access to did not refresh their...
41
3094
by: AngleWyrm | last post by:
I have created a new container class, called the hat. It provides random selection of user objects, both with and without replacement, with non-uniform probabilities. Uniform probabilities are a degenerate case, and can also be stored. Here's the web-page, with complete source, illustration, and example usage. Take a look-see, and post your critique! http://home.comcast.net/~anglewyrm/hat.html
0
1159
by: Morten Overgaard | last post by:
Hi (Sorry for the cross-posting) We are developing a SOAPService which has its types defines in different XSDs like CommonTypes.xsd (namespace http:/MyNamespace/commonTypes -ComplexTypeA -ComplexTypeB -ComplexTypeC
6
3498
by: | last post by:
Hi, can someone provide some advise on how to get around with using auto generated proxies? basically I already have the proxy classes, and they are used by other places. I'd like use these existing classes instead of having to generate another set of proxy classes, which are going to be very similar to my existing classes. any idea? thanks, -Jason
1
2771
by: tomazi75-nospam(at)gmail.com | last post by:
Hello all, I've a problem using urllib2 with a proxy which need authentication. I've tested the 'simple way' : -- code -- import urllib # example values for the post
7
2118
by: WXS | last post by:
Vote for this idea if you like it here: http://lab.msdn.microsoft.com/productfeedback/viewfeedback.aspx?feedbackid=5fee280d-085e-4fe2-af35-254fbbe96ee9 ----------------------------------------------------------------------------- This is a consortium of ideas from another thread on topic ----------------------------------------------------------------------------- One of the big issues of organizing items within a class, is there are many...
2
3726
by: SenthilVel | last post by:
Hi All i am getting an error in remoting proxies like the below : Exception rethrown at : at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&
1
2487
by: SenthilVel | last post by:
Hi All i am getting an error in remoting proxies like the below : Exception rethrown at : at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&
1
1766
by: james | last post by:
Hi Guys, Is it expensive to create proxies in WCF? I always create new proxy instances (when not using sessions) so I don't have to worry about a proxy falling into a Faulted state. I started an application that where performance is an issue, and I was curious if creating new proxies is going to create a noticeable slowdown. Thanks, James
0
9704
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9571
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10561
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10302
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10069
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9132
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7608
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
4277
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3803
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.