Mega Code Archive

 
Categories / VB.Net / Reflection
 

Type IsInterface tells whether the Type is an interface; that is, not a class or a value type

Imports System Imports Microsoft.VisualBasic Interface myIFace End Interface 'myIFace Class MyIsInterface     Public Shared Sub Main()         Try             Dim myBool1 As Boolean = GetType(myIFace).IsInterface             Console.WriteLine(myBool1.ToString)         Catch e As Exception             Console.WriteLine(ControlChars.Cr + "An exception occurred: {0}", e.Message.ToString)         End Try     End Sub End Class