C# Type GUID
Description
Type GUID
gets the GUID associated with the Type.
Syntax
Type.GUID
has the following syntax.
public abstract Guid GUID { get; }
Example
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.
/*from ww w. j av a 2 s . c om*/
using System;
public class MyClass1
{
public void MyMethod1()
{
}
}
class MyGetTypeFromCLSID
{
public static void Main()
{
Type myType = typeof(MyClass1);
Guid myGuid =(Guid) myType.GUID;
Console.WriteLine(myType.ToString());
Console.WriteLine(myType.GUID);
}
}
The code above generates the following result.