C# Get form names of project A from Project B

后端 未结 3 809
我寻月下人不归
我寻月下人不归 2021-01-26 11:02

I have two Projects in one solution, project A and project B (using VS2010 Ultimate and C# windows application). Project B ac

3条回答
  •  借酒劲吻你
    2021-01-26 11:40

    Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); 
    foreach (Assembly a in assemblies) 
    { 
        Type[] types = a.GetTypes(); 
        foreach (Type t in types) 
        { 
            if (t.BaseType == typeof(Form)) 
            { 
                      //Do Your works
            } 
        } 
    } 
    

提交回复
热议问题