次の方法で共有


UInt32Converter クラス

32 ビット符号なし整数オブジェクトのさまざまな表現への変換や、その逆の変換を行う型コンバータを提供します。

この型のすべてのメンバの一覧については、UInt32Converter メンバ を参照してください。

System.Object
   System.ComponentModel.TypeConverter
      System.ComponentModel.BaseNumberConverter
         System.ComponentModel.UInt32Converter

Public Class UInt32Converter
   Inherits BaseNumberConverter
[C#]
public class UInt32Converter : BaseNumberConverter
[C++]
public __gc class UInt32Converter : public BaseNumberConverter
[JScript]
public class UInt32Converter extends BaseNumberConverter

スレッドセーフ

この型の public static (Visual Basicでは Shared) のすべてのメンバは、マルチスレッド操作で安全に使用できます。インスタンスのメンバの場合は、スレッドセーフであるとは限りません。

解説

このコンバータは、32 ビット符号なし整数オブジェクトの文字列への変換と、その逆の変換だけを実行できます。

UInt32 値型は、値が 0 から 4,294,967,295 までの範囲の符号なし整数を表します。このデータ型は Visual Basic ではサポートされていません。

メモ    UInt32Converter のインスタンスは作成しないでください。代わりに、 TypeDescriptorGetConverter メソッドを呼び出します。詳細については、 TypeConverter 基本クラスのトピックの例と、「 型コンバータの実装 」を参照してください。

使用例

[Visual Basic, C#, C++] UInt32 型の変数を文字列に変換する方法と、その逆の変換を行う方法を次の例に示します。

 
'This data type is not supported in Visual Basic.
    . . . 
'This data type is not supported in Visual Basic.

[C#] 
uint myUInt32 = 967299;
string myUInt32String = "1345556";
Console.WriteLine(TypeDescriptor.GetConverter(myUInt32).ConvertTo(myUInt32, typeof(string))); 
Console.WriteLine(TypeDescriptor.GetConverter(myUInt32).ConvertFrom(myUInt32String));    
    . . . 
uint myUInt32 = 967299;
string myUInt32String = "1345556";
Console.WriteLine(TypeDescriptor.GetConverter(myUInt32).ConvertTo(myUInt32, typeof(string))); 
Console.WriteLine(TypeDescriptor.GetConverter(myUInt32).ConvertFrom(myUInt32String));    

[C++] 
unsigned int myUInt32( 967299 );
String* myUInt32String = S"1345556";
Console::WriteLine(TypeDescriptor::GetConverter(__box(myUInt32))->ConvertTo(__box(myUInt32), __typeof(String)));
Console::WriteLine(TypeDescriptor::GetConverter(__box(myUInt32))->ConvertFrom(myUInt32String));
    . . . 
unsigned int myUInt32( 967299 );
String* myUInt32String = S"1345556";
Console::WriteLine(TypeDescriptor::GetConverter(__box(myUInt32))->ConvertTo(__box(myUInt32), __typeof(String)));
Console::WriteLine(TypeDescriptor::GetConverter(__box(myUInt32))->ConvertFrom(myUInt32String));

[JScript] JScript のサンプルはありません。Visual Basic、C#、および C++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン 言語のフィルタ をクリックします。

必要条件

名前空間: System.ComponentModel

プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ

アセンブリ: System (System.dll 内)

参照

UInt32Converter メンバ | System.ComponentModel 名前空間