CredentialCache.DefaultCredentials プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > CredentialCache.DefaultCredentials プロパティの意味・解説 

CredentialCache.DefaultCredentials プロパティ

アプリケーションシステム資格情報取得します

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

Public Shared ReadOnly Property
 DefaultCredentials As ICredentials
Dim value As ICredentials

value = CredentialCache.DefaultCredentials
public static ICredentials DefaultCredentials
 { get; }
public:
static property ICredentials^ DefaultCredentials {
    ICredentials^ get ();
}
/** @property */
public static ICredentials get_DefaultCredentials
 ()
public static function get
 DefaultCredentials () : ICredentials

プロパティ
アプリケーションシステム資格情報を表す ICredentials。

解説解説
使用例使用例

DefaultCredentials プロパティ使用してアプリケーションシステム資格情報取得するコード例次に示します

' Assuming "Windows Authentication" has been set as; 
' Directory Security settings for default web site in IIS.
Dim url As String = "http://localhost"
' Create a 'HttpWebRequest' object with the specified url. 
Dim myHttpWebRequest As HttpWebRequest = CType(WebRequest.Create(url),
 HttpWebRequest)
' Assign the credentials of the logged in user or the user being impersonated.
myHttpWebRequest.Credentials = CredentialCache.DefaultCredentials
' Send the 'HttpWebRequest' and wait for response.            
Dim myHttpWebResponse As HttpWebResponse =
 CType(myHttpWebRequest.GetResponse(), HttpWebResponse)
Console.WriteLine("Authentication successful")
Console.WriteLine("Response received successfully")
// Ensure Directory Security settings for default web site in IIS is
 "Windows Authentication".
string url = "http://localhost";
// Create a 'HttpWebRequest' object with the specified url. 
HttpWebRequest myHttpWebRequest = (HttpWebRequest)WebRequest.Create(url); 
// Assign the credentials of the logged in user or the user being impersonated.
myHttpWebRequest.Credentials = CredentialCache.DefaultCredentials;
// Send the 'HttpWebRequest' and wait for response.            
HttpWebResponse myHttpWebResponse = (HttpWebResponse)myHttpWebRequest.GetResponse();
 
Console.WriteLine("Authentication successful");
Console.WriteLine("Response received successfully");
// Ensure Directory Security settings for default web site in IIS is
 "Windows Authentication".
String^ url = "http://localhost";

// Create a 'HttpWebRequest' object with the specified url.
HttpWebRequest^ myHttpWebRequest = dynamic_cast<HttpWebRequest^>(WebRequest::Create(
 url ));

// Assign the credentials of the logged in user or the user being impersonated.
myHttpWebRequest->Credentials = CredentialCache::DefaultCredentials;

// Send the 'HttpWebRequest' and wait for response.
HttpWebResponse^ myHttpWebResponse = dynamic_cast<HttpWebResponse^>(myHttpWebRequest->GetResponse());
Console::WriteLine( "Authentication successful" );
Console::WriteLine( "Response received successfully" );

// Ensure Directory Security settings for default web site in IIS 
// is "Windows Authentication".
String url = "http://localhost";

// Create a 'HttpWebRequest' object with the specified url. 
HttpWebRequest myHttpWebRequest = (HttpWebRequest)WebRequest.
    Create(url);

// Assign the credentials of the logged in user or the user being 
// impersonated.
myHttpWebRequest.set_Credentials(CredentialCache.
    get_DefaultCredentials());

// Send the 'HttpWebRequest' and wait for response.            
HttpWebResponse myHttpWebResponse 
    = (HttpWebResponse)myHttpWebRequest.GetResponse();

Console.WriteLine("Authentication successful");
Console.WriteLine("Response received successfully");
.NET Framework のセキュリティ.NET Frameworkセキュリティ
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「CredentialCache.DefaultCredentials プロパティ」の関連用語

CredentialCache.DefaultCredentials プロパティのお隣キーワード
検索ランキング

   

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



CredentialCache.DefaultCredentials プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS