zoukankan      html  css  js  c++  java
  • .NET应用程序域

        .NET可执行程序承载在进程的一个逻辑分区中,属于称为“应用程序域(AppDomain)”。

        一个进程可以承载多个应用程序域,每个应用程序域承载一个.NET可执行程序。

        

        列举当前应用程序域中的程序集

    代码
    class Program
        {
            
    /// <summary>
            
    /// 
            
    /// Print All Assemblies In AppDomain
            
    /// from <pro c#>
            
    /// modified by fred song
            
    /// 2010.7.11
            
    /// 
            
    /// </summary>
            
    /// <param name="ad"></param>
            public static void PrintAllAssembliesInAppDomain(AppDomain ad)
            {
                Assembly[] loadedAssemblies 
    = ad.GetAssemblies();
                Console.WriteLine(
    "*****Here are the assemblies loaded in {0} ********"
                    , ad.FriendlyName);
                
    foreach (Assembly a in loadedAssemblies)
                {
                    Console.WriteLine(
    "->Name:{0}", a.GetName().Name);
                    Console.WriteLine(
    "->Version:{0}", a.GetName().Version);
                }
            }

            
    static void Main(string[] args)
            {
                Console.WriteLine(
    "*******Test AppDomain********");

                AppDomain defaultAD 
    = AppDomain.CurrentDomain;

                MessageBox.Show(
    "hello world");

                PrintAllAssembliesInAppDomain(defaultAD);
                Console.ReadLine();
            }
  • 相关阅读:
    联赛练习:好数
    CF703D Mishka and Interesting sum
    POJ2689 Prime Distance
    联赛练习:draw
    题解:luogu P2634 [国家集训队]聪聪可可
    题解:luoguP3806 【模板】点分治1(在线处理询问做法)
    题解:luogu P1073 最优贸易
    题解报告——聪聪与可可
    题解报告——森林
    题解报告——星际战争
  • 原文地址:https://www.cnblogs.com/muyoushui/p/1775431.html
Copyright © 2011-2022 走看看