class1.cs

来自「Professional C# 2nd Edition」· CS 代码 · 共 29 行

CS
29
字号
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");

			// Comment out this next line for the 2nd Example
			secondDomain.ExecuteAssembly("AssemblyA.exe");

			// Uncomment the next block, and comment out the above line to run the 2nd Example
			/*
			secondDomain.CreateInstance("AssemblyA",
				"Wrox.ProCSharp.Assemblies.AppDomains.Class1", true,
				System.Reflection.BindingFlags.CreateInstance,
				null, new object[] {7, 3}, null, null, null);

			*/

		}
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?