Hello cisco man,
As for the WebRequest.GetS ystemWebPRoxy it does return a
"System.Net.Web Request+WebProx yWrapperOpaque" type which is internal.
Actually, when using the returned object from WebRequest.GetS ystemWebProxy
method, you're always suggested to use the "IWebProxy" interface as that
interface has provide all the necessary properties.
For the "useDefaultCred entials" property of WebProxy class, it simply
assign the corresponding credentials to the IWebProxy.Crede ntials
property(accord ing to the given value). Here is the diassembed code from
reflector:
=====from WebProxy class======
public bool UseDefaultCrede ntials
{
get
{
if (!(this.Credent ials is SystemNetworkCr edential))
{
return false;
}
return true;
}
set
{
this._Credentia ls = value ? CredentialCache .DefaultCredent ials
: null;
}
}
public ICredentials Credentials
{
get
{
return this._Credentia ls;
}
set
{
this._Credentia ls = value;
}
}
=============== =
therefore, the setting "UseDefaultCred entials" of WebProxy to true is
identical to the following code (for IWebProxy):
=============== ========
IWebProxy proxy = WebRequest.GetS ystemWebProxy() ;
proxy.Credentia ls = System.Net.Cred entialCache.Def aultCredentials ;
=============== ========
Hope this helps.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
=============== =============== =============== =====
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
=============== =============== =============== =====
This posting is provided "AS IS" with no warranties, and confers no rights.