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

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

WebClient.Encoding プロパティ

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

文字列アップロードダウンロード使用する Encoding取得または設定します

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

解説解説

UploadString メソッドと UploadStringAsync メソッドは、指定した文字列アップロードする前に、このプロパティ使用して文字列Byte 配列変換します詳細については、O:System.Text.Encoding.GetBytes メソッドトピック参照してください

DownloadString メソッドまたは DownloadStringAsync メソッド使用して文字列ダウンロードしたときに、WebClient はこのプロパティによって返される Encoding使用してダウンロードされた Byte 配列文字列変換します詳細については、O:System.Text.Encoding.GetString メソッドトピック参照してください

使用例使用例

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

Public Shared Sub UploadString(ByVal
 address As String)

    Dim data As String =
 "Time = 12:00am temperature = 50"
    Dim client As WebClient = New
 WebClient()
    '  Optionally specify an encoding for uploading and downloading
 strings.
    client.Encoding = System.Text.Encoding.UTF8
    '  Upload the data.
    Dim reply As String
 = client.UploadString(address, data)
    '  Disply the server's response.
    Console.WriteLine(reply)
End Sub

public static void UploadString
 (string address)
{
    string data = "Time = 12:00am temperature = 50";
    WebClient client = new WebClient ();
    // Optionally specify an encoding for uploading and downloading
 strings.
    client.Encoding = System.Text.Encoding.UTF8;
    // Upload the data.
    string reply = client.UploadString (address, data);
    // Disply the server's response.
    Console.WriteLine (reply);
}

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



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

辞書ショートカット

すべての辞書の索引

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

   

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



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

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

©2024 GRAS Group, Inc.RSS