Type.GetTypeCode-Methode
Ruft den zugrunde liegenden Typcode des angegebenen Type ab.
Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Syntax
'Declaration
Public Shared Function GetTypeCode ( _
type As Type _
) As TypeCode
'Usage
Dim type As Type
Dim returnValue As TypeCode
returnValue = Type.GetTypeCode(type)
public static TypeCode GetTypeCode (
Type type
)
public:
static TypeCode GetTypeCode (
Type^ type
)
public static TypeCode GetTypeCode (
Type type
)
public static function GetTypeCode (
type : Type
) : TypeCode
Parameter
- type
Der Type, dessen zugrunde liegender Typcode abgerufen werden soll.
Rückgabewert
Der TypeCode-Wert des zugrunde liegenden Typs.
Beispiel
' Creates an object of 'Type' class.
Dim myType1 As Type = Type.GetType("System.Int32")
' Get the 'TypeCode' of the 'Type' class object created above.
Dim myTypeCode As TypeCode = Type.GetTypeCode(myType1)
Console.WriteLine("TypeCode is: {0}", myTypeCode)
// Create an object of 'Type' class.
Type myType1 = Type.GetType("System.Int32");
// Get the 'TypeCode' of the 'Type' class object created above.
TypeCode myTypeCode = Type.GetTypeCode(myType1);
Console.WriteLine("TypeCode is: {0}",myTypeCode);
// Create an object of 'Type' class.
Type^ myType1 = Type::GetType( "System.Int32" );
// Get the 'TypeCode' of the 'Type' class object created above.
TypeCode myTypeCode = Type::GetTypeCode( myType1 );
Console::WriteLine( "TypeCode is: {0}", myTypeCode );
// Create an object of 'Type' class.
Type myType1 = Type.GetType("System.Int32");
// Get the 'TypeCode' of the 'Type' class object created above.
TypeCode myTypeCode = Type.GetTypeCode(myType1);
Console.WriteLine("TypeCode is: {0}", myTypeCode);
Plattformen
Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile für Pocket PC, Windows Mobile für Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.
Versionsinformationen
.NET Framework
Unterstützt in: 2.0, 1.1, 1.0
.NET Compact Framework
Unterstützt in: 2.0, 1.0