vs2005 如何在新建窗体中加载DLL(新窗体),求步骤
vs2005 如何在新建窗体中加载DLL(新窗体),求步骤 --------------------编程问答-------------------- /// <summary>/// 加载DLL窗口
/// </summary>
/// <param name="DllName">Dll名称</param>
/// <param name="FormName">窗口所在类的名称</param>
public Form LoadFormHandle(string DllName, string FormName)
{
DllPath = DllDirectory + "\\" + DllName;
Assembly Ass = Assembly.LoadFrom(@DllPath);
if (Ass == null) return null;
Type type = Ass.GetType(FormName);
if(type==null) return null;
Object obj = Activator.CreateInstance(type);//利用指定的参数实例话类型
if (obj != null)
{
Form FormShow = (Form)obj;
return FormShow;
}
else
return null;
}
在你要的类里面应用该方法
补充:.NET技术 , C#