このメソッドは,.NET Framework インフラストラクチャをサポートします。独自に作成したコードから直接使用するためのものではありません。
指定した列挙型の値を等価な文字列形式に変換します。
名前空間: System.Web.UI
アセンブリ: System.Web (system.web.dll 内)
構文
'宣言
Public Shared Function EnumToString ( _
enumType As Type, _
enumValue As Object _
) As String
'使用
Dim enumType As Type
Dim enumValue As Object
Dim returnValue As String
returnValue = PropertyConverter.EnumToString(enumType, enumValue)
public static string EnumToString (
Type enumType,
Object enumValue
)
public:
static String^ EnumToString (
Type^ enumType,
Object^ enumValue
)
public static String EnumToString (
Type enumType,
Object enumValue
)
public static function EnumToString (
enumType : Type,
enumValue : Object
) : String
適用できません。
パラメータ
- enumType
enumValue の列挙型を表す System.Type。
- enumValue
変換する値。
戻り値
enumValue の文字列形式。
例外
例外の種類 | 条件 |
---|---|
enumType パラメータまたは enumValue パラメータが null 参照 (Visual Basic では Nothing) です。 |
|
enumType パラメータが System.Enum 型ではありません。 または enumValue パラメータに、enumType とは型の異なる列挙体からの値が含まれます。 または enumValue の型が、enumType の基になる型ではありません。 |
解説
EnumToString メソッドは、列挙値を等価の文字列形式に変換するときに使用します。
![]() |
---|
このメンバは .NET Framework インフラストラクチャをサポートします。コードから直接使用するためのものではありません。列挙値を等価の文字列形式に変換するには、Enum.Format メソッドを使用します。 |
プラットフォーム
Windows 98,Windows Server 2000 SP4,Windows CE,Windows Millennium Edition,Windows Mobile for Pocket PC,Windows Mobile for Smartphone,Windows Server 2003,Windows XP Media Center Edition,Windows XP Professional x64 Edition,Windows XP SP2,Windows XP Starter Edition
Microsoft .NET Framework 3.0 は Windows Vista,Microsoft Windows XP SP2,および Windows Server 2003 SP1 でサポートされています。
バージョン情報
.NET Framework
サポート対象 : 3.0,2.0,1.1,1.0
参照
関連項目
PropertyConverter クラス
PropertyConverter メンバ
System.Web.UI 名前空間
Enum.Format