Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
DefaultNetworkCredentials Property
Collapse the table of content
Expand the table of content

CredentialCache.DefaultNetworkCredentials Property

Note: This property is new in the .NET Framework version 2.0.

Gets the network credentials of the current security context.

Namespace: System.Net
Assembly: System (in system.dll)

public static NetworkCredential DefaultNetworkCredentials { get; }
/** @property */
public static NetworkCredential get_DefaultNetworkCredentials ()

public static function get DefaultNetworkCredentials () : NetworkCredential

Property Value

An NetworkCredential that represents the network credentials of the current user or application.

The credentials returned by the DefaultNetworkCredentials property is applicable only for NTLM, negotiate, and Kerberos-based authentication.

The credentials returned by DefaultNetworkCredentials represents the authentication credentials for the current security context in which the application is running. For a client-side application, these are usually the Windows credentials (user name, password, and domain) of the user running the application. For ASP.NET applications, the default network credentials are the user credentials of the logged-in user, or the user being impersonated.

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0

Community Additions

© 2015 Microsoft