How to get physical path and absolute path for Global.asax
This article will explain in detail how to take the physical path and absolute path of Global.asax. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.
Virtual path
The code is as follows:
What Server.MapPath ("~ /") gets is the virtual path.
Take absolute path
The code is as follows:
String absolutelyPath = AppDomain.CurrentDomain.BaseDirectory
Take physical path and application path
The code is as follows:
System.Web.HttpContext.Current.Request.ApplicationPath
This is the end of the article on "how to take the physical path and absolute path of Global.asax". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.