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

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

WebClient.ResponseHeaders プロパティ

応答関連付けられているヘッダーの名前/値ペアコレクション取得します

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

Public ReadOnly Property
 ResponseHeaders As WebHeaderCollection
Dim instance As WebClient
Dim value As WebHeaderCollection

value = instance.ResponseHeaders
public WebHeaderCollection ResponseHeaders { get;
 }
public:
property WebHeaderCollection^ ResponseHeaders {
    WebHeaderCollection^ get ();
}
/** @property */
public WebHeaderCollection get_ResponseHeaders ()
public function get ResponseHeaders
 () : WebHeaderCollection

プロパティ
応答関連付けられているヘッダーの名前/値のペア格納している WebHeaderCollection。応答受信しなかった場合null 参照 (Visual Basic では Nothing)。

解説解説

ResponseHeaders プロパティは、WebClient が応答受信するヘッダー情報を含む WebHeaderCollection インスタンス格納します

使用例使用例

サーバーから返されResponseHeadersダウンロードし、表示するコード例次に示します

' ResponseHeaders is a WebHeaderCollection instance that contains the
 headers sent back 
 ' in response to the WebClient request. 
Dim myWebHeaderCollection As WebHeaderCollection
 = myWebClient.ResponseHeaders
Console.WriteLine(ControlChars.Cr + "Displaying the response headers"
 + ControlChars.Cr)
' Loop through the ResponseHeaders.
Dim i As Integer
For i = 0 To myWebHeaderCollection.Count -
 1
    ' Display the headers as name/value pairs.
    Console.WriteLine((ControlChars.Tab + myWebHeaderCollection.GetKey(i) + "
 " + ChrW(61) + " " + myWebHeaderCollection.Get(i)))
Next i 
// Obtain the WebHeaderCollection instance containing the header name/value
 pair from the response.
WebHeaderCollection myWebHeaderCollection = myWebClient.ResponseHeaders;
Console.WriteLine("\nDisplaying the response headers\n");
// Loop through the ResponseHeaders and display the header name/value
 pairs.
for (int i=0; i < myWebHeaderCollection.Count;
 i++)                
    Console.WriteLine ("\t" + myWebHeaderCollection.GetKey(i) + "
 = " + myWebHeaderCollection.Get(i));
// Obtain the WebHeaderCollection instance containing the header name/value
 pair from the response.
WebHeaderCollection^ myWebHeaderCollection = myWebClient->ResponseHeaders;
Console::WriteLine( "\nDisplaying the response headers\n" );

// Loop through the ResponseHeaders and display the header name/value
 pairs.
for ( int i = 0; i < myWebHeaderCollection->Count;
 i++ )
{
   Console::WriteLine( "\t{0} = {1}", myWebHeaderCollection->GetKey(
 i ),
      myWebHeaderCollection->Get( i ) );
}
// Obtain the WebHeaderCollection instance containing the 
// header name/value pair from the response.
WebHeaderCollection myWebHeaderCollection = 
    myWebClient.get_ResponseHeaders();
Console.WriteLine("\nDisplaying the response headers\n");
// Loop through the ResponseHeaders and display the header
// name/value pairs.
for (int i = 0; i < myWebHeaderCollection.get_Count();
 i++) {
    Console.WriteLine("\t" + myWebHeaderCollection.GetKey(i) 
        + " = " + myWebHeaderCollection.Get(i));
}  
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


このページでは「.NET Framework クラス ライブラリ リファレンス」からWebClient.ResponseHeaders プロパティを検索した結果を表示しています。
Weblioに収録されているすべての辞書からWebClient.ResponseHeaders プロパティを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からWebClient.ResponseHeaders プロパティ を検索

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

辞書ショートカット

すべての辞書の索引

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

   

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



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

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

©2025 GRAS Group, Inc.RSS