dotnet学习笔记三 - 程序域程序集,dotnet学习,otnet学习笔,tnet学习笔记,net学习笔记三,et学习笔记三-,t学习笔记三-程,学习笔记三-程序,习笔记三-程序域,笔记三-程序域程,记三-程序域程序

本站地址:http://www.bajiao123.com

dotnet学习笔记三 - 程序域程序集
[STAThread] static void
{
//
// TODO: Add code to start app
//
Console.WriteLine( "CurrentDomain Name is: {0}", AppDomain.CurrentDomain.FriendlyName );
AppDomain newDomain = AppDomain.CreateDomain( "New Domain", null, null );
newDomain.ExecuteAssembly( "ConsoleApp
}
}
}
使用AppDomain类的静态变量CurrentDomain可以得到当前AppDomain的引用。使用静态函数CreateDomain可以创建新的AppDomain。ExecuteAssembly可以执行某个程序集。上面代码中的两个AppDomain:CurrentDomain和newDomain就在同一个进程中,这一点可以通过Windows任务管理器察看进程数得到,运行时系统进程数只增加了一。
本站地址:http://www.bajiao123.com

