C# Type MetadataToken

Description

Type MetadataToken gets a value that identifies a metadata element.

Syntax

Type.MetadataToken has the following syntax.


public virtual int MetadataToken { get; }

Example


//www. j  a  va2s.  co m

using System;

internal class InternalOnly 
{
    public class Nested {}
}

public class Example
{
    public class Nested {}

    public static void Main()
    {
        Type t = typeof(InternalOnly.Nested);
        Console.WriteLine(t.MetadataToken);

    }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System »




Array
BitConverter
Boolean
Byte
Char
Console
ConsoleKeyInfo
Convert
DateTime
DateTimeOffset
Decimal
Double
Enum
Environment
Exception
Guid
Int16
Int32
Int64
Math
OperatingSystem
Random
SByte
Single
String
StringComparer
TimeSpan
TimeZone
TimeZoneInfo
Tuple
Tuple
Tuple
Type
UInt16
UInt32
UInt64
Uri
Version