Imports System
Class MainApp
Public Shared Sub Main()
Try
Dim myString1 As String = "DIRECT.111.3"
Dim myString2 As String = "WrongProgID"
Dim myType1 As Type = Type.GetTypeFromProgID(myString1, True)
Console.WriteLine("GUID for ProgID DirControl.DirList.1 is {0}.", myType1.GUID.ToString())
Dim myType2 As Type = Type.GetTypeFromProgID(myString2, True)
Catch e As Exception
Console.WriteLine("An exception occurred.")
Console.WriteLine("Source: {0}", e.Source.ToString())
Console.WriteLine("Message: {0}", e.Message.ToString())
End Try
End Sub
End Class
|