using System;
using System.Reflection;
// 程序集-应用程序域
namespace cxj
{
class b
{
static void Main(string[] args)
{
AppDomain cd = AppDomain.CurrentDomain;
Console.WriteLine(cd.FriendlyName);
AppDomain cd2 = AppDomain.CreateDomain("new appDomain");
cd2.ExecuteAssembly("c.exe");
Console.ReadKey();
}
}
}
using System;
namespace cxj
{
class A
{
static void Main(string[] args)
{
Console.WriteLine("Hello World");
Console.ReadKey();
}
}
}
using System;
using System.Reflection;
// 程序集-应用程序域
namespace cxj
{
public class b
{
public static void Main(string[] args)
{
AppDomain cd = AppDomain.CurrentDomain;
Console.WriteLine(cd.FriendlyName);
AppDomain cd2 = AppDomain.CreateDomain("new appDomain");
//cd2.ExecuteAssembly("c.exe");
cd2.CreateInstance("c.exe","cxj.A",true,BindingFlags.CreateInstance,null,null,null,null);
Console.ReadKey();
}
}
}