473,471 Members | 2,008 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How do I get WebProxy to work in HttpWebRequest?

I found an example online and when I tried repeating it with the proxy I
normally use for my browser, I get errors.

What I do is this:

WebProxy proxy = new WebProxy("http://www.autoconfig/pac", true);

That url is exactly what I enter into Firefox advanced settings to get
beyond the office firewall here, but C# does not like it.

any idea?

the proxy is free, no login credentials required so I did not set that
object in code. You can try it yourself now, the proxy wont interfere with
the fact you are not behind a firewall.
Nov 21 '07 #1
3 4176
MrNobody,

Are you actually setting the Proxy property of the HttpWebRequest to
that instance of the WebProxy?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"MrNobody" <Mr******@discussions.microsoft.comwrote in message
news:20**********************************@microsof t.com...
>I found an example online and when I tried repeating it with the proxy I
normally use for my browser, I get errors.

What I do is this:

WebProxy proxy = new WebProxy("http://www.autoconfig/pac", true);

That url is exactly what I enter into Firefox advanced settings to get
beyond the office firewall here, but C# does not like it.

any idea?

the proxy is free, no login credentials required so I did not set that
object in code. You can try it yourself now, the proxy wont interfere with
the fact you are not behind a firewall.

Nov 21 '07 #2
Yes indeed,

req.Proxy = proxy;

"Nicholas Paldino [.NET/C# MVP]" wrote:
MrNobody,

Are you actually setting the Proxy property of the HttpWebRequest to
that instance of the WebProxy?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"MrNobody" <Mr******@discussions.microsoft.comwrote in message
news:20**********************************@microsof t.com...
I found an example online and when I tried repeating it with the proxy I
normally use for my browser, I get errors.

What I do is this:

WebProxy proxy = new WebProxy("http://www.autoconfig/pac", true);

That url is exactly what I enter into Firefox advanced settings to get
beyond the office firewall here, but C# does not like it.

any idea?

the proxy is free, no login credentials required so I did not set that
object in code. You can try it yourself now, the proxy wont interfere with
the fact you are not behind a firewall.


Nov 21 '07 #3
And what kind of errors are you getting? Can you create a complete
example program?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"MrNobody" <Mr******@discussions.microsoft.comwrote in message
news:D7**********************************@microsof t.com...
Yes indeed,

req.Proxy = proxy;

"Nicholas Paldino [.NET/C# MVP]" wrote:
>MrNobody,

Are you actually setting the Proxy property of the HttpWebRequest to
that instance of the WebProxy?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"MrNobody" <Mr******@discussions.microsoft.comwrote in message
news:20**********************************@microso ft.com...
>I found an example online and when I tried repeating it with the proxy I
normally use for my browser, I get errors.

What I do is this:

WebProxy proxy = new WebProxy("http://www.autoconfig/pac", true);

That url is exactly what I enter into Firefox advanced settings to get
beyond the office firewall here, but C# does not like it.

any idea?

the proxy is free, no login credentials required so I did not set that
object in code. You can try it yourself now, the proxy wont interfere
with
the fact you are not behind a firewall.



Nov 21 '07 #4

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

Similar topics

1
by: Jim Douglas | last post by:
I have a requirement to dynamically create a webProxy object in C#. I have created an instance of the webProxy and stored it within a hashtable then placing the hashtable in cache. When required I...
4
by: vooose | last post by:
Consider accessing a webpage through a proxy server: WebRequest request = WebRequest.Create("http://somepage.com"); WebProxy proxy = new WebProxy(proxyHost, proxyPort); proxy.Credentials = new...
2
by: Sam Santiago | last post by:
I am using the WebProxy.GetDefaultProxy() function to read the IE settings, but it's returning an empty WebProxy object. Are there any known reasons why this is not reading the proxy settings in IE...
0
by: Michael S. Scherotter | last post by:
I am building a C# desktop application in .Net 1.1 that consumes web services. I use System.Net.WebProxy.GetDefaultProxy() to get the proxy settings from IE but I get reports from people who are...
4
by: Andrew | last post by:
Morning everybody, I have an XML document located on a web address and I wish to create a C# program to read that XML document and process it - which shouldn't be that difficult yet I'm running...
0
by: JTowns | last post by:
Hi, all I have a problem of the following kind. There's a remote server that can be accessed via HTTPS (say, https://remoteserver). This server doesn't allow anonymous users, so I have to...
7
by: djc | last post by:
I see many ways to accomplish setting up proxy settings for a web request in the documentation but many of them are marked as obsolete. 1) What is the current and correct way to tell all my...
0
by: J Ames | last post by:
Please, if this is the incorrect forum for this question, let me know which forum is most appropriate. I want to make sure I get visibility with the proper gurus! I have a .NET console app that...
7
by: Phil | last post by:
According to the help this method is obsolete, but there is no hint as to what to use now instead. It does seem to work for me, although I get a warning error from the compiler. The warning...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
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 ...
0
muto222
php
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.