WebClient.Encoding プロパティ
アセンブリ: System (system.dll 内)

/** @property */ public Encoding get_Encoding () /** @property */ public void set_Encoding (Encoding value)
文字列のエンコードに使用する Encoding。このプロパティの既定値は、Default によって返されるエンコーディングです。

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); }

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からWebClient.Encoding プロパティを検索する場合は、下記のリンクをクリックしてください。

- WebClient.Encoding プロパティのページへのリンク