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

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

HttpWebResponse.CharacterSet プロパティ

応答文字セット取得します

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

例外例外
解説解説
使用例使用例

応答文字セット取得する例を次に示します

Try
   Dim myHttpWebRequest As HttpWebRequest =
 CType(WebRequest.Create(url), HttpWebRequest)
   Dim myHttpWebResponse As HttpWebResponse
 = CType(myHttpWebRequest.GetResponse(), HttpWebResponse)
   
   Console.WriteLine(("The encoding method used is: "
 + myHttpWebResponse.ContentEncoding))
   Console.WriteLine(("The character set used is :"
 + myHttpWebResponse.CharacterSet))
   
   Dim seperator As Char
 = "/"c
   Dim contenttype As [String] = myHttpWebResponse.ContentType
   ' Retrieve 'text' if the content type is of 'text/html.
   Dim maintype As [String] = contenttype.Substring(0,
 contenttype.IndexOf(seperator))
   ' Display only 'text' type.
   If [String].Compare(maintype, "text")
 = 0 Then
      Console.WriteLine(ControlChars.NewLine + " Content type is
 'text'.")
      
try 
       {    
        HttpWebRequest myHttpWebRequest = (HttpWebRequest)WebRequest.Create(url);
 
        HttpWebResponse myHttpWebResponse = (HttpWebResponse)myHttpWebRequest.GetResponse();
 

        Console.WriteLine("The encoding method used is: " + myHttpWebResponse.ContentEncoding);
        Console.WriteLine("The character set used is :"
 + myHttpWebResponse.CharacterSet);

        char seperator = '/';
        String contenttype = myHttpWebResponse.ContentType;
        // Retrieve 'text' if the content type is of 'text/html.
        String maintype = contenttype.Substring(0,contenttype.IndexOf(seperator));
        // Display only 'text' type.
        if (String.Compare(maintype,"text") == 0) 
            {
            Console.WriteLine("\n Content type is 'text'.");

try
{
   HttpWebRequest^ myHttpWebRequest = (HttpWebRequest^)( WebRequest::Create( url
 ) );
   HttpWebResponse^ myHttpWebResponse = (HttpWebResponse^)( myHttpWebRequest->GetResponse()
 );

   Console::WriteLine( "The encoding method used is: {0}", myHttpWebResponse->ContentEncoding
 );
   Console::WriteLine( "The character set used is : {0}",
 myHttpWebResponse->CharacterSet );

   char separator = '/';
   String^ contenttype = myHttpWebResponse->ContentType;
   // Retrieve 'text' if the content type is of 'text/html.
   String^ maintype = contenttype->Substring( 0, contenttype->IndexOf( separator
 ) );
   // Display only 'text' type.
   if ( String::Compare( maintype, "text" ) == 0 )
   {
      Console::WriteLine( "\n Content type is 'text'." );
try {
    HttpWebRequest myHttpWebRequest = (HttpWebRequest)
        WebRequest.Create(url);
    HttpWebResponse myHttpWebResponse = (HttpWebResponse)
        myHttpWebRequest.GetResponse();
    Console.WriteLine("The encoding method used is: " 
        +  myHttpWebResponse.get_ContentEncoding());
    Console.WriteLine("The character set used is :"
 
        +  myHttpWebResponse.get_CharacterSet());
    char seperator = '/';
    String contentType = myHttpWebResponse.get_ContentType();

    // Retrieve 'text' if the content type is of 'text/html.
    String mainType = contentType.Substring(0,
        contentType.IndexOf(seperator));

    // Display only 'text' type.
    if (String.Compare(mainType,"text") == 0) {
        Console.WriteLine("\n Content type is 'text'.");
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


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

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

辞書ショートカット

すべての辞書の索引

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

   

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



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

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

©2025 GRAS Group, Inc.RSS