Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/290.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C#Winform运行时加载Windows窗体控制器库_C#_Winforms_Dll_Runtime - Fatal编程技术网

C#Winform运行时加载Windows窗体控制器库

C#Winform运行时加载Windows窗体控制器库,c#,winforms,dll,runtime,C#,Winforms,Dll,Runtime,我想在C#Winform app中加载包含Windows窗体控制器库的dll文件运行时。 我需要帮助 感谢您的帮助: 霍伯特 或者使用反射 string assemblyPath = @"D:/MyAssembly.dll"; Assembly MyDll = Assembly.Load(assemblyPath); Type MyLoadClass = MyDll.GetType("MyDll.MyClass"); object obj = Activator.CreateInstance(M

我想在C#Winform app中加载包含Windows窗体控制器库的dll文件运行时。
我需要帮助

感谢您的帮助:
霍伯特

或者使用反射

string assemblyPath = @"D:/MyAssembly.dll";
Assembly MyDll = Assembly.Load(assemblyPath);
Type MyLoadClass = MyDll.GetType("MyDll.MyClass");
object obj = Activator.CreateInstance(MyLoadClass);

请使用下面的代码

using System.Reflection;

Assembly dll= Assembly.Load("DALL"); //DALL name of your assembly
Type MyLoadClass = dll.GetType("DALL.LoadClass"); // name of your class
 object  obj = Activator.CreateInstance(MyLoadClass)
using System.Reflection;

Assembly dll= Assembly.Load("DALL"); //DALL name of your assembly
Type MyLoadClass = dll.GetType("DALL.LoadClass"); // name of your class
 object  obj = Activator.CreateInstance(MyLoadClass)