zoukankan      html  css  js  c++  java
  • Web AppDomain

    using System;
    using System.Collections.Generic;
    using System.IO;
    using System.Linq;
    using System.Web;
    using System.Web.Hosting;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    
    namespace WebApplication3
    {
        public partial class WebForm1 : System.Web.UI.Page
        {
            protected void Page_Load(object sender, EventArgs e)
            {
                Type hostType = typeof(Intelligencer);
                string f = hostType.FullName;
                Intelligencer intelligencer = System.Web.Hosting.ApplicationHost.CreateApplicationHost(hostType, "/", Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "bin")) as Intelligencer;//方法按照以下顺序寻找hostType定义:1.GAC,2.网站物理文件目录Bin文件夹下,如果没有加到GAC中的话,在网站应用程序下创建Bin文件夹,然后将程序集放入。
                ltl1.Text += string.Format("Current Domain ID: {0} <br>", AppDomain.CurrentDomain.Id);
                ltl1.Text += string.Format("Virtual Path: {0} <br>", HostingEnvironment.ApplicationVirtualPath);
                ltl1.Text += string.Format("Physcical Path: {0} <br>", HostingEnvironment.ApplicationPhysicalPath);
            }
        }
    
        public class Intelligencer : System.MarshalByRefObject
        {
    
        }
    }
  • 相关阅读:
    mysql分表技术(学习心得)
    Linux下搭建DNS服务器
    php简单单例模式
    JQuery的ajaxFileUpload图片上传初试
    Binary Tree Level Order Traversal II
    Remove Element
    Symmetric Tree
    Balanced Binary Tree
    Power of Two
    Merge Two Sorted Lists
  • 原文地址:https://www.cnblogs.com/JingG/p/3106412.html
Copyright © 2011-2022 走看看