ByteConverter クラス
アセンブリ: System (system.dll 内)


このコンバータは、8 ビット符号なし整数オブジェクトの文字列への変換と、その逆の変換だけを実行できます。
型コンバータの詳細については、TypeConverter 基本クラスのトピックおよび「方法 : 型コンバータを実装する」を参照してください。
![]() |
---|
ByteConverter のインスタンスは作成しないでください。代わりに、TypeDescriptor の GetConverter メソッドを呼び出します。詳細については、TypeConverter 基本クラスのトピックの例を参照してください。 このクラスに適用される HostProtectionAttribute 属性の Resources プロパティの値は、SharedState です。HostProtectionAttribute は、デスクトップ アプリケーション (一般的には、アイコンをダブルクリック、コマンドを入力、またはブラウザに URL を入力して起動するアプリケーション) には影響しません。詳細については、HostProtectionAttribute クラスのトピックまたは「SQL Server プログラミングとホスト保護属性」を参照してください。 |

8 ビット符号なし整数と文字列を宣言および初期化するコード例を次に示します。次に、コードはそれぞれをほかの型に変換します。
Dim myUint As Byte = 5 Dim myUStr As String = "2" Console.WriteLine(TypeDescriptor.GetConverter(myUint).ConvertTo(myUint, GetType(String))) Console.WriteLine(TypeDescriptor.GetConverter(myUint).ConvertFrom(myUStr))
byte myUint = 5; string myUStr = "2"; Console.WriteLine(TypeDescriptor.GetConverter(myUint).ConvertTo(myUint, typeof(string))); Console.WriteLine(TypeDescriptor.GetConverter(myUint).ConvertFrom(myUStr));

System.ComponentModel.TypeConverter
System.ComponentModel.BaseNumberConverter
System.ComponentModel.ByteConverter


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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


- ByteConverter クラスのページへのリンク