VB.Net by API/System/Activator — различия между версиями

Материал из VB Эксперт
Перейти к: навигация, поиск
м (1 версия)
 
(нет различий)

Текущая версия на 12:51, 26 мая 2010

Activator.CreateInstance

  

imports System.Reflection
Imports System.Windows.Forms
Public Class Tester
    Public Shared Sub Main
      try
        dim strUrl as String = "http" & "://localhost/MultiFileAssyVB/vbDeploy.exe"
        dim a as [Assembly] = [Assembly].LoadFrom(strUrl)
        dim t as Type = a.GetType("Form1")
        dim o as Object = Activator.CreateInstance(t)
        dim frm as Form = CType(o, Form)
        frm.Show()
      catch ex as Exception
        Console.WriteLine(ex.ToString)
      End Try         
    End Sub
End Class