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();
            }
  • 相关阅读:
    嘉佣坊
    HTTPS
    OWIN 为WebAPI
    C#并行编程
    ASP.NET 运行
    DocFX
    oracle SELECT INTO 和 INSERT INTO SELECT 两种表复制语句详解
    Facebook新框架React Native,一套搞定App开发[转]
    MVC 中使用 SignalR 实现推送功能
    生产都消费者模式的一个demo,消费者设置缓存
  • 原文地址:https://www.cnblogs.com/muyoushui/p/1775431.html
Copyright © 2011-2022 走看看