473,396 Members | 1,961 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,396 software developers and data experts.

How to make WebRequest from ASP without accessing registry for pro

Hi Everyone,

I have a .NET dll that uses the HTTPWebRequest class to make an HTTP
connection to an off-site server. This dll works just fine from a Winform but
when I try to use it from an ASP page (via COM Interop) and get a registry
access exception. I know why this happening. The dll makes the request using
the following:

request = CType(WebRequest.Create(url), HttpWebRequest)

When the dll is being instanciated from an ASP page the ASP process attemps
to read the registry in order to obtain the default proxy value set in
Internet Explorer. Unfourtunetly the ASP process does not have the
permissions to do this, hence the exception being thrown.

I can get around this by changing the <proxy "usesystemdefault=true"> node
of the machine.config to "false". This prevents the dll from even looking for
proxy information. However, since the default value in the machine.config is
"true" I would like to find a solution in the code to prevent checking for a
proxy. This way I do not have to alter the machine.config on the web servers
I deploy to.

I have tried using the following to tell the WebRequest that I do not need
to check for a proxy:

request = CType(WebRequest.Create(url), HttpWebRequest)
request.Proxy = GlobalProxySelection.GetEmptyWebProxy()

However, this does not seem to work because the exception is being thrown on
the first line when I attempt to create the WebRequest.

Any suggestions that someone might have would be appreciated. I have been
combing the web via Google to find and answer but to no avail. Thanks again!

- Dwek
Nov 18 '05 #1
1 1207
Hi Dwek,

Thanks for your posting. As for this problem, I've posted my reply in
another former thread of yours:

Subject: Re: HTTPWebResponse: Winform = Pass; ASP DLL = Fail

in this group. I'd appreciate if you have a look there. If there're any
further questions, please feel free to post in either thread. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 19 '05 #2

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

Similar topics

3
by: Daniel Pope | last post by:
Hello Everybody, I'm preparing for doing a daunting task: to access Out look Microsoft Outlook Express(regardles the operating system and Outlook version) from a Java applet (after the client...
2
by: gizmo | last post by:
Hi, I'm using the following code to request the html source from the quoted site. ...... string url = "http://www1.soccerstand.com/"; WebRequest webRequest = WebRequest.Create(url);...
3
by: Frank Schwarz | last post by:
Hello, we are implemting an application that uses a https connection for accessing a website. It is also possible to connect via http. With http every thing works fine. With https it is not...
1
by: Tim Regan | last post by:
Hi All, I'm writing an app using WebRequest in csharp. I need the app to respond to the host PC moving from one network to another, e.g. taking a laptop home after work. Currently the...
12
by: ThyRock | last post by:
I am working on a WebRequest accessing the US Postal Service WebTools test API. This service uses a DLL file (ShippingAPITest.dll) with a query string which includes XML. The web service accepts...
2
by: Mostafa Salama | last post by:
i have a problem in accessing registry from web service i made a web service that call a function to access registry The web service contain the following code Dim RegKey As...
0
by: jesper.hvid | last post by:
Hi. I've noticed, after moving some of our code to 2.0, that System.Net.WebRequest.Create(System.String) and System.Uri(System.String) no longer behave as they did in 1.1 framework. Example:...
3
by: archana | last post by:
Hi all, My main question is when i send webrequest to server, do ip address related information is also getting send onto server over network? I want to send request using webrequest class....
1
by: David Schrader | last post by:
Hello all, Let me start by saying that I'm not certain whether this belongs here, in this notes group, or another more developmentally oriented one. I'll try starting here then go elsewhere if...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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: 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...

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.