473,608 Members | 1,811 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

WebRequest - Proxy Authentication Required

I started using .NET 2003 and my first application is to parse an HTML form.
But I am behind an ISA firewall and get "(407) Proxy Authentication
Required" with the following code. The proxy settings in webReq.Proxy
appear to be OK, even without setting them as below. IE works, but this
does not. Any ideas? (or where to ask?) -- David

Dim webReq As WebRequest = WebRequest.Crea te(txtUrl.Text)
webReq.Proxy = WebProxy.GetDef aultProxy
Dim webResp As WebResponse = webReq.GetRespo nse
Dim sr As New StreamReader(we bResp.GetRespon seStream, Encoding.ASCII)
Dim html As String = sr.ReadToEnd()
sr.Close()
Nov 20 '05 #1
2 6462
David,

You may want to set the Credentials property of your WebRequest object.

Telmo Sampaio
"davidcbrow n" <dc******@remov ethisfrontierne t.net> wrote in message
news:Op******** ******@tk2msftn gp13.phx.gbl...
I started using .NET 2003 and my first application is to parse an HTML form. But I am behind an ISA firewall and get "(407) Proxy Authentication
Required" with the following code. The proxy settings in webReq.Proxy
appear to be OK, even without setting them as below. IE works, but this
does not. Any ideas? (or where to ask?) -- David

Dim webReq As WebRequest = WebRequest.Crea te(txtUrl.Text)
webReq.Proxy = WebProxy.GetDef aultProxy
Dim webResp As WebResponse = webReq.GetRespo nse
Dim sr As New StreamReader(we bResp.GetRespon seStream, Encoding.ASCII)
Dim html As String = sr.ReadToEnd()
sr.Close()

Nov 20 '05 #2
Sorry, I should have mentioned that I had tried that too with no success.

David

"Telmo Sampaio" <ts******@gmail .com> wrote in message
news:Om******** ******@TK2MSFTN GP09.phx.gbl...
David,

You may want to set the Credentials property of your WebRequest object.

Telmo Sampaio

"davidcbrow n" <dc******@remov ethisfrontierne t.net> wrote in message
news:Op******** ******@tk2msftn gp13.phx.gbl...
I started using .NET 2003 and my first application is to parse an HTML

form.
But I am behind an ISA firewall and get "(407) Proxy Authentication
Required" with the following code. The proxy settings in webReq.Proxy
appear to be OK, even without setting them as below. IE works, but this
does not. Any ideas? (or where to ask?) -- David

Dim webReq As WebRequest = WebRequest.Crea te(txtUrl.Text)
webReq.Proxy = WebProxy.GetDef aultProxy
Dim webResp As WebResponse = webReq.GetRespo nse
Dim sr As New StreamReader(we bResp.GetRespon seStream, Encoding.ASCII)
Dim html As String = sr.ReadToEnd()
sr.Close()


Nov 20 '05 #3

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

Similar topics

1
6368
by: Mark Ferguson | last post by:
I've been trying to get a simple pycurl script working with an authenticating proxy, here is the code (with changes to protect the guilty!): from pycurl import * import StringIO b = StringIO.StringIO() c = Curl()
8
2391
by: John K. | last post by:
Hi I was wondering if it's possible to use the WebRequest class to access a file on windows shared folder with authentication? If yes, what would the syntax be? I've tried to look this up in the references available but to no avail Also, is it safer (better practise) in an LAN environment to use HTTP requests to access shared files (via ASP.NET) rather than UNC file shares TIA Regards John
4
7223
by: Terry | last post by:
Hello, I am trying to get a response for an .aspx page in my current project (same virtual directory) by using WebRequest.GetResponse but I keep getting a exception with "500 Internal server error" in the exception message. I am able to do this fine with another .aspx page that has no code-behind. The page that has code-behind throws the exception. What I am doing is getting the .aspx response, reading the stream, replacing
3
7762
by: Wild Wind | last post by:
Hello all, I apologise in advance for the long windedness of this post, but I feel that if I am going to get any solution to this problem, it is important that I present as much information that will be useful in diagnosing the problem. I have an application which calls a method of a web service that we host remotely. I have deployed the application to a
6
12478
by: Jensen Bredhal | last post by:
Hello, I need to send command to a web server from a method. I understand this should be possible using the WebClient or WebRequest class. how can this be done? below an example of my HTTP based command to the server:
2
11418
by: rcp | last post by:
Hi all, I've read all posts from all existing threads and none of them worked to solve my problem, although its exactly the same. I'll try to explain my case and see if a kind soul could help me out: I've a win32 service in C# on a client machine A, which accesses a WS (C#) on a server machine B (hosted on an IIS) Case 1: If I try to add the WSDL for the WS through VS2005, the 'Discovery
4
5989
by: Boni | last post by:
I want consuming a webserivce trough a proxy. I use this code. myService s = new myService (); System.Net.WebProxy proxyObject = new System.Net.WebProxy("http://proxyhost:8080"); s.Proxy = proxyObject; It doesn't works, it returns a error HTTP 407: Proxy Authentication Required ( Access is denied. ). But my proxy don't need a user Authentication.
7
40957
by: chandru1782 | last post by:
Dear friends, I am trying to use CPAN for installing some perl modules. i am using a ubuntu system, which has internet connection through lan and authenticated proxy. when trying to install cpan.pm , it gives the following error, can any one help, You have no /root/.cpan/sources/MIRRORED.BY I'm trying to fetch one CPAN: LWP::UserAgent loaded ok Fetching with LWP:
5
5448
by: =?Utf-8?B?TWFyaw==?= | last post by:
I'm researching what is the best way to create a generic WCF proxy wrapper that has the following requirements: 1. Remove the System.ServiceModel config section requirement for clients. We have our own configuration management that follows our application lifecycle (development/system test/production). Also, most of the proxies we build are for the middle-tier layer. 2. Create a wrapper to follow WCF Client best practices (proxy.close...
0
8069
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
8488
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8160
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
6826
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
6017
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...
0
3972
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4036
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1611
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1339
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.