Mega Code Archive

 
Categories / VB.Net Tutorial / Development
 

Load Assembly from a url

imports System.Reflection              ' necessary  for instantiating assemblies Imports System.Windows.Forms Public Class Tester     Public Shared Sub Main                try                        dim strUrl as String = "http" & "://localhost/MultiFileAssyVB/vbDeploy.exe" '                      dim strUrl as String = "http" & "://localhost/MultiFileAssy/csDeploy.exe"                        dim a as [Assembly] = [Assembly].LoadFrom(strUrl)                                                dim t as Type = a.GetType("Form1") '                      dim t as Type = a.GetType("csDeploy.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