HttpWebRequest.UseDefaultCredentials Property
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets a Boolean value that controls whether default credentials are sent with requests.
public:
virtual property bool UseDefaultCredentials { bool get(); void set(bool value); };
public override bool UseDefaultCredentials { get; set; }
member this.UseDefaultCredentials : bool with get, set
Public Overrides Property UseDefaultCredentials As Boolean
true
if the default credentials are used; otherwise, false
. The default value is false
.
You attempted to set this property after the request was sent.
Ettevaatust!
WebRequest
, HttpWebRequest
, ServicePoint
, and WebClient
are obsolete, and you shouldn't use them for new development. Use HttpClient instead.
Set this property to true
when requests made by this HttpWebRequest object should, if requested by the server, be authenticated using the credentials of the currently logged on user. For client applications, this is the desired behavior in most scenarios. For middle-tier applications, such as ASP.NET applications, instead of using this property, you would typically set the Credentials property to the credentials of the client on whose behalf the request is made.
Toode | Versioonid |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |
UWP | 10.0 |
Toote „.NET“ tagasiside
.NET on avatud lähtekoodiga projekt. Tagasiside andmiseks valige link: