(1)WebForm中:

  HttpContext.Current.Server.MapPath("~/Files/car/");

(2)Mvc中:

  Server.MapPath()

(3)最底层的写法:

  String path = AppDomain.CurrentDomain.SetupInformation.ApplicationBase;
             path = string.Format(@"{0}Data\Log\{1}\", path, DateTime.Now.ToString("yyyy-MM-dd"));//按时间格式保存日志文件

相关文章:

  • 2022-02-27
  • 2021-06-24
  • 2022-12-23
  • 2022-01-08
  • 2022-12-23
  • 2022-01-25
猜你喜欢
  • 2021-11-17
  • 2022-01-11
  • 2021-11-26
相关资源
相似解决方案