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

Home Posts Topics Members FAQ

System.Net.Cred entialCache.Def aultCredentials are blank

Hello,

I have a windows form application that needs to pass through a proxy
to get access to the internet. As a test, I have successfully
hardcoded my login/password/domain combination and been able to gain
access through the proxy.

I would like to ditch the hardcoded login/password/domain combination
and use the settings defined in Internet Explorer. I've read that I
can use System.Net.Cred entialCache.Def aultCredentials to get the
credentials of the machine that the application is running from. When
I try this, all the fields in DefaultCredenti als are blank and of
course I get denied access through the proxy.

Any clues to what I'm doing wrong or what would cause the
DefaultCredenti als to be blank? I've duplicated the behaviour on two
machines, both running XP SP1. Here's an excerpt of my code ...
// code is quite simple and in this example, I've tried to assign
DefaultCredenti als to the proxy object and the Web Service.

RService rs = new RService();

WebProxy proxyObject = new WebProxy("http://proxyaddress:po rt");
proxyObject.Cre dentials =
System.Net.Cred entialCache.Def aultCredentials ;

bool success = false;
string message = string.Empty;

try
{
rs.Proxy = proxyObject;
rs.Credentials = System.Net.Cred entialCache.Def aultCredentials ;
success = rs.IsReachable( );
}
catch (SoapException soapEx)
{
message = soapEx.ToString ();
}
catch (Exception ex)
{
message = ex.ToString();
}
Any help would be appreciated. Thanks!

Steve
Nov 16 '05 #1
0 8291

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

Similar topics

3
9126
by: Terrence | last post by:
I am doing some of the C# walkthroughs to transition from VB to C#. When I try to execute static void Main() { Aplication.Run(new Form1()) } I raise a 'System.NullReferenceException" in system.windows.forms.dll
0
2594
by: Craig | last post by:
We have an anonymous web application trying to talk to a windows authenticated webservice. This is currently failing with 401 Access Denied errors. We have found that we can get this to work by writing the following code in the web application before calling the webservice: WebServiceInstance.Credentials = new NetworkCredential("username", "password","domain");
0
1388
by: JOS | last post by:
Hi, I have a web application with the following in the web.config file 1 <authentication mode="Windows" /> 2 <identity impersonate="true" /> My IIS settings are shown below However the System.Net.CredentialCache.DefaultCredentials is not being
0
1521
by: ndskim | last post by:
Currently I have the Web Services Proxy code generated by the WSDL.Exe command line. My Web app consists of ASP.NET in VB 2005 version. Here is what I have in the sample code: ' Set Proxy Credentials to the current network DefaultCredentials. With lds_WebService
1
4327
by: goddyg | last post by:
I have a windows form application that needs to pass through a proxy to get access to the internet. As a test, I have successfully hardcoded my login/password/domain combination and been able to gain access through the proxy. I would like to ditch the hardcoded login/password/domain combination and use the settings defined in Internet Explorer. I've read that I can use System.Net.CredentialCache.DefaultCredentials to get the credentials...
0
1324
by: Joerg Lueders | last post by:
Hi, I created simple code to get information from a Web Service. I need to pass credentials for the Web Service as well as for the Proxy Server (static address). This works fine as long as login and pwd are hard-coded. Best would be if the app could use the standard proxy-settings of IE without any login data. But this does not work.
11
20233
by: ckb | last post by:
Hi, I have an active x ctrl on my page and using asp.net I i have built a web page that has a web service named e1.I am using CreateSessionImpersonated() but it does not Impersonate and every time asks for the user name and the password.The code is Can anybody help me on this please. Thankyou.
3
1901
sid0404
by: sid0404 | last post by:
Hi I am new to the programming in c#, I have an application where I need to get data from a website now I am getting an error message if I give the input as two strings, say Sun Microsystems while f I just give one input then I have the following error message: An unhandled exception of type 'System.Net.WebException' occurred in System.dll Additional information: The server committed a protocol violation. Section=ResponseStatusLine ...
5
8294
by: Henry Stock | last post by:
I am trying to understand the following error: Any thing you can tell me about this is appreciated. Security Exception Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file. Exception Details: for the permission of type
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
8011
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
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...
0
8358
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...
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
2479
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
1611
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.