获取网站所运行的程序域

以下代码是在查看NOP中看到的 感觉很不错

/// <summary>         /// Gets a physical disk path of \Bin directory         /// </summary>         /// <returns>The physical path. E.g. "c:\inetpub\wwwroot\bin"</returns>         public virtual string GetBinDirectory()         {             if (HostingEnvironment.IsHosted)             {                 //hosted                 return HttpRuntime.BinDirectory;             }             //not hosted. For example, run either in unit tests             return AppDomain.CurrentDomain.BaseDirectory;         }
posted @ 2015-01-04 11:34  特洛伊-Micro  阅读(206)  评论(0编辑  收藏  举报