Get the App
SLTechnology News&Howtos  ›  Development  › 

How to get physical path and absolute path for Global.asax

Shulou Source: shulou.com Published: 2022-06-03 07:17:05 10月04日 Update

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.

Tags: Paths physics code articles more good practical content that is applications articles knowledge programs references help applications related Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB Huawei MySQL OPPO Reno Microsoft