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

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

HttpListenerResponse.StatusDescription プロパティ

メモ : このプロパティは、.NET Framework version 2.0新しく追加されたものです。

クライアント返される HTTP ステータス コード説明テキスト取得または設定します

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

Public Property StatusDescription As
 String
Dim instance As HttpListenerResponse
Dim value As String

value = instance.StatusDescription

instance.StatusDescription = value
public string StatusDescription { get;
 set; }
public:
property String^ StatusDescription {
    String^ get ();
    void set (String^ value);
}
/** @property */
public String get_StatusDescription ()

/** @property */
public void set_StatusDescription (String value)
public function get StatusDescription
 () : String

public function set StatusDescription
 (value : String)

プロパティ
クライアント返される HTTP ステータス コード説明テキスト既定値は、StatusCode プロパティ値に対すRFC 2616 の説明、または RFC 2616 の説明存在しない場合空の文字列 ("") です。

解説解説
使用例使用例

このプロパティの値を設定するコード例次に示します

// When the client is not authenticated, there is no Identity.
if (context.User == null)
{
    message.Append ("<HTML><BODY><p> Hello local user! </p></BODY></HTML>");
}
else
{
    // Get the requester's identity.
    System.Security.Principal.WindowsIdentity identity = WindowsIdentity.GetCurrent();
    // Construct the response body.
    message.AppendFormat ("<HTML><BODY><p> Hello {0}!<br/>",
 
        identity.Name);
    message.AppendFormat ("You were authenticated using {0}.</p>",
 
        identity.AuthenticationType);
    message.Append ("</BODY></HTML>");
}

// Configure the response.
HttpListenerResponse response = context.Response;

// Use the encoding from the response if one has been set.
// Otherwise, use UTF8.
System.Text.Encoding encoding = response.ContentEncoding;
if (encoding == null)
{
    encoding = System.Text.Encoding.UTF8;
    response.ContentEncoding = encoding;
}
byte[] buffer = encoding.GetBytes (message.ToString ());
response.ContentLength64 = buffer.Length;
response.StatusCode = (int) HttpStatusCode.OK;
response.StatusDescription = "OK";
response.ProtocolVersion = new Version ("1.1");
// Don't keep the TCP connection alive; 
// We don't expect multiple requests from the same client.
response.KeepAlive = false;
// Write the response body.
System.IO.Stream stream = response.OutputStream;
stream.Write(buffer, 0, buffer.Length);
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
HttpListenerResponse クラス
HttpListenerResponse メンバ
System.Net 名前空間
HttpListener クラス
HttpListenerContext クラス
HttpListenerRequest クラス


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

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

辞書ショートカット

すべての辞書の索引

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

   

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



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

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

©2025 GRAS Group, Inc.RSS