473,396 Members | 1,774 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.

System.Net.CredentialCache.DefaultCredentials 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.CredentialCache.DefaultCredentials to get the
credentials of the machine that the application is running from. When
I try this, all the fields in DefaultCredentials 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
DefaultCredentials 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
DefaultCredentials to the proxy object and the Web Service.

RService rs = new RService();

WebProxy proxyObject = new WebProxy("http://proxyaddress:port");
proxyObject.Credentials =
System.Net.CredentialCache.DefaultCredentials;

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

try
{
rs.Proxy = proxyObject;
rs.Credentials = System.Net.CredentialCache.DefaultCredentials;
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 8251

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

Similar topics

3
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...
0
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...
0
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 ...
0
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...
1
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...
0
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...
11
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...
3
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...
5
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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...
0
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...
0
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,...

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.