WebResponse.IsMutuallyAuthenticated プロパティ
アセンブリ: System (system.dll 内)

クライアントとサーバーの両方が認証された場合は true。それ以外の場合は false。

相互認証を要求するには、MutualAuthRequested 列挙値または MutualAuthRequired 列挙値を使用して WebRequest.AuthenticationLevel プロパティを設定します。WebRequest.AuthenticationLevel プロパティの既定値には、Delegation と MutualAuthRequested が含まれています。

// The following example uses the System, System.Net, // and System.IO namespaces. public static void RequestMutualAuth(Uri resource) { // Create a new HttpWebRequest object for the specified resource. WebRequest request=(WebRequest) WebRequest.Create(resource); // Request mutual authentication. request.AuthenticationLevel = AuthenticationLevel.MutualAuthRequested; // Supply client credentials. request.Credentials = CredentialCache.DefaultCredentials; HttpWebResponse response = (HttpWebResponse) request.GetResponse(); // Determine whether mutual authentication was used. Console.WriteLine("Is mutually authenticated? {0}", response.IsMutuallyAuthenticated); // Read and display the response. Stream streamResponse = response.GetResponseStream(); StreamReader streamRead = new StreamReader(streamResponse); string responseString = streamRead.ReadToEnd(); Console.WriteLine(responseString); // Close the stream objects. streamResponse.Close(); streamRead.Close(); // Release the HttpWebResponse. response.Close(); }
// The following example uses the System, System.Net, // and System.IO namespaces. static void RequestMutualAuth( Uri^ resource ) { // Create a new HttpWebRequest object for the specified resource. WebRequest^ request = dynamic_cast<WebRequest^>(WebRequest::Create( resource )); // Request mutual authentication. request->AuthenticationLevel = AuthenticationLevel::MutualAuthRequested; // Supply client credentials. request->Credentials = CredentialCache::DefaultCredentials; HttpWebResponse^ response = dynamic_cast<HttpWebResponse^>(request->GetResponse()); // Determine whether mutual authentication was used. Console::WriteLine( L"Is mutually authenticated? {0}", response->IsMutuallyAuthenticated ); // Read and display the response. Stream^ streamResponse = response->GetResponseStream(); StreamReader^ streamRead = gcnew StreamReader( streamResponse ); String^ responseString = streamRead->ReadToEnd(); Console::WriteLine( responseString ); // Close the stream objects. streamResponse->Close(); streamRead->Close(); // Release the HttpWebResponse. response->Close(); }

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
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からWebResponse.IsMutuallyAuthenticated プロパティを検索する場合は、下記のリンクをクリックしてください。

- WebResponse.IsMutuallyAuthenticated プロパティのページへのリンク