首页 > Web开发 > 详细

获取网站所运行的程序域

时间:2015-01-04 12:02:12      阅读:204      评论:0      收藏:0      [点我收藏+]
以下代码是在查看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;         }

获取网站所运行的程序域

原文:http://www.cnblogs.com/micro-chen/p/4200670.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!