[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
Gets the GUID associated with the Type.
Namespace: System
Assembly: mscorlib (in mscorlib.dll)
A GUID is associated with a type using the GuidAttribute attribute.
The following example creates the class MyClass1 with a public method, creates a Type object corresponding to MyClass1, and gets the Guid structure using the GUID property of the Type class.
using System; class MyGetTypeFromCLSID { public class MyClass1 { public void MyMethod1() { } } public static void Main() { // Get the type corresponding to the class MyClass. Type myType = typeof(MyClass1); // Get the object of the Guid. Guid myGuid =(Guid) myType.GUID; Console.WriteLine("The name of the class is "+myType.ToString()); Console.WriteLine("The ClassId of MyClass is "+myType.GUID); } }
Windows 8 Release Preview, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 SP2, Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

