Mega Code Archive

 
Categories / VB.Net / Reflection
 

Type GUID Property gets the GUID associated with the Type

Imports System Class MainClass     Public Class MyClass1         Public Sub MyMethod1()         End Sub      End Class      Public Shared Sub Main()         Dim myType As Type = GetType(MyClass1)         Dim myGuid As Guid = CType(myType.GUID, Guid)         Console.WriteLine(("The name of the class is " + myType.ToString()))         Console.WriteLine(("The ClassId of MyClass is " + myType.GUID.ToString()))     End Sub End Class