ABPmvc5服务层获取网站目录
命令
AppDomain.CurrentDomain.BaseDirectory
测试
using System; using System.Web.Mvc; using Abp.Web.Mvc.Authorization; using Castle.Core.Logging; namespace YinLongWebSite.Web.Controllers { [AbpMvcAuthorize] public class HomeController : YinLongWebSiteControllerBase { public ActionResult Index() { Logger.Debug(AppDomain.CurrentDomain.BaseDirectory); return View(); } } }
输出
DEBUG 2020-07-18 10:54:02,506 [7 ] ngWebSite.Web.Controllers.HomeController - D:\IIS网站\Publish\

作者:银龙
-------------------------------------------
个性签名:独学而无友,则孤陋而寡闻。做一个灵魂有趣的人!
如果觉得这篇文章对你有小小的帮助的话,记得在右下角点个“推荐”哦,博主在此感谢!
万水千山总是情,打赏一分行不行,所以如果你心情还比较高兴,也是可以扫码打赏博主,哈哈哈(っ•̀ω•́)っ✎⁾⁾!
浙公网安备 33010602011771号