一个exe中可以调用另一个exe,或另一个exe的方法:
-------------用程序域实现:
AppDomain 类用于创建和中断应用程序域。
1建立控制台AssemblyA
using System;

namespace Wrox.ProCSharp.Assemblies.AppDomains


{
class Class1

{
public Class1(int val1, int val2)

{
Console.WriteLine("Constructor with the values {0}, {1}" +
" in domain {2} called", val1, val2,
AppDomain.CurrentDomain.FriendlyName);
}
[STAThread]
static void Main(string[] args)

{
Console.WriteLine("Main in domain {0} called",
AppDomain.CurrentDomain.FriendlyName);
}
}
}

产生。exe。
2建立控制台DomainTest
using System;
namespace Wrox.ProCSharp.Assemblies.AppDomains


{
class Test

{
[STAThread]
static void Main(string[] args)

{
AppDomain currentDomain = AppDomain.CurrentDomain;
Console.WriteLine(currentDomain.FriendlyName);
AppDomain secondDomain =
AppDomain.CreateDomain("New AppDomain");
// secondDomain.ExecuteAssembly("AssemblyA.exe");
secondDomain.CreateInstance("AssemblyA",
"Wrox.ProCSharp.Assemblies.AppDomains.Class1", true,
System.Reflection.BindingFlags.CreateInstance,

null, new object[]
{7, 3}, null, null, null);

}
}
}

结果:
DomainTest.exe
Constructor with the values 7, 3 in domain New AppDomain called
Press any key to continue
或
DomainTest.exe
Constructor with the values 7, 3 in domain New AppDomain called
Press any key to continue
---------------------用程序集的反射也可以实现一个exe调用另一个exe的方法!
:system.Type 可以访问任何给定的数据类型的信息
:system.Assembly访问给定程序集的元数据,也可以加载和执行程序集的方法