且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在c#中从字符串调用表单

更新时间:2023-11-04 20:44:16

查看 Activator.CreateInstance(String, String):

Activator.CreateInstance("Namespace.Forms", "Login");

你也可以使用 Assembly 类(在 System.Reflection 命名空间中):

you can also use the Assembly class (in System.Reflection namespace):

Assembly.GetExecutingAssembly().CreateInstance("Login");