共用方式為


HttpRequestMessageExtensionMethods.SetUserPrincipal 方法

定義

取代與指定之 HTTP 要求訊息相關聯的使用者主體。

public:
[System::Runtime::CompilerServices::Extension]
 static void SetUserPrincipal(System::Net::Http::HttpRequestMessage ^ httpRequestMessage, System::Security::Principal::IPrincipal ^ user);
public static void SetUserPrincipal (this System.Net.Http.HttpRequestMessage httpRequestMessage, System.Security.Principal.IPrincipal user);
static member SetUserPrincipal : System.Net.Http.HttpRequestMessage * System.Security.Principal.IPrincipal -> unit
<Extension()>
Public Sub SetUserPrincipal (httpRequestMessage As HttpRequestMessage, user As IPrincipal)

參數

httpRequestMessage
HttpRequestMessage

要在其中設定使用者主體的 HTTP 要求訊息。

user
IPrincipal

要設定的使用者主體。

適用於