AuthenticationLevelとは? わかりやすく解説

AuthenticationLevel 列挙体

WMI (Windows Management Instrumentation) に接続するために使用する認証レベルを記述します。これは WMI への COM 接続で使用します。

名前空間: System.Management
アセンブリ: System.Management (system.management.dll 内)
構文構文

Public Enumeration AuthenticationLevel
Dim instance As AuthenticationLevel
public enum AuthenticationLevel
public enum class AuthenticationLevel
public enum AuthenticationLevel
public enum AuthenticationLevel
メンバメンバ
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

AuthenticationLevel 列挙体

メモ : この列挙体は、.NET Framework version 2.0 で新しく追加されたものです。

WebRequest クラスおよびその派生クラスを使用してリソースを要求する場合の、認証と偽装に関するクライアント要件を指定します。

名前空間: System.Net.Security
アセンブリ: System (system.dll 内)
構文構文

Public Enumeration AuthenticationLevel
Dim instance As AuthenticationLevel
public enum AuthenticationLevel
public enum class AuthenticationLevel
public enum AuthenticationLevel
public enum AuthenticationLevel
メンバメンバ
解説解説
使用例使用例

要求の認証フラグを設定するコード例を次に示します。

// 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();
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
System.Net.Security 名前空間



英和和英テキスト翻訳

英語⇒日本語日本語⇒英語

辞書ショートカット

すべての辞書の索引

「AuthenticationLevel」の関連用語

AuthenticationLevelのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



AuthenticationLevelのページの著作権

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2026 Microsoft.All rights reserved.

©2026 GRAS Group, Inc.RSS