调用其他命名空间中的函数,方法如下:
运行命名空间test2下的Main1(),即运行窗体_2_11
namespace test2 {
static class Program2
{
[STAThread]
public static void Main1()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new _2_11());
}
}
}
namespace test1
{
static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
test2.Program2.Main1();
}
}
}
如有转载请注明来源: www.dreamload.cn/blog/?p=266&preview=true (洋葱先生)