473,546 Members | 2,468 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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(WebReques t.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 "usesystemdefau lt=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(WebReques t.Create(url), HttpWebRequest)
request.Proxy = GlobalProxySele ction.GetEmptyW ebProxy()

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 1219
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
8132
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 (user) acknowleges to run this applet on his machine). The user has to read the existent user Microsoft Outlook users accounts and to setup another...
2
9689
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); WebResponse webResponse = webRequest.GetResponse(); beginStr = new StreamReader(webResponse.GetResponseStream(),
3
6862
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 possible to connect to the web site. The tunnel is established
1
3149
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 WebRequest.Proxy is always picked up from the work network settings, so that the GetResponse method throws a WebException when the proxy is unreachable. But...
12
2850
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 the query string with no url encoding. I must pass the <> characters as they are in the query string. If these characters are url encoded the service...
2
2420
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 Microsoft.Win32.RegistryKey RegKey = Microsoft.Win32.Registry.LocalMachine RegKey = RegKey.OpenSubKey(KeyPath, True) but it gives me an error, unauthorized access of...
0
1786
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: string emailHttpPath =
3
2858
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. But i don't want to send any information like my Pc name or my pc's ip address or the proxy address to server using webrequest. If every time while...
1
1620
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 you decide otherwise. (Already forwarded here, sort-of, from: microsoft.public.windowsnt.registry.) I'm writing a Visual Basic program which...
0
7435
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...
0
7947
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...
1
7461
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...
0
7792
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...
1
5360
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...
0
5080
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
1921
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
1
1046
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
747
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...

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.