为Request.AppRelativeCurrentExecutionFilePath设置的路径在哪里

时间:2022-05-06 22:53:32

I need to know the path for Request.AppRelativeCurrentExecutionFilePath. It gives the wrong file path when I retrieve any requests.

我需要知道Request.AppRelativeCurrentExecutionFilePath的路径。当我检索任何请求时,它会给出错误的文件路径。

1 个解决方案

#1


0  

it gets the virtual path of the application root and makes it relative by using the tilde (~) notation for the application root.

它获取应用程序根的虚拟路径,并通过使用应用程序根的波浪号(〜)表示法使其相对。

so if your application is hosted at http://localhost/WebApp1 and you want to access Picture1.jpg in the root directory, using that will return ~/Picture1.jpg

因此,如果您的应用程序托管在http:// localhost / WebApp1,并且您想要访问根目录中的Picture1.jpg,则使用它将返回〜/ Picture1.jpg

string _directoryName = Request.AppRelativeCurrentExecutionFilePath + "Picture1.jpg" will return http://localhost/WebApp1/Picture1.jpg

string _directoryName = Request.AppRelativeCurrentExecutionFilePath +“Picture1.jpg”将返回http://localhost/WebApp1/Picture1.jpg

#1


0  

it gets the virtual path of the application root and makes it relative by using the tilde (~) notation for the application root.

它获取应用程序根的虚拟路径,并通过使用应用程序根的波浪号(〜)表示法使其相对。

so if your application is hosted at http://localhost/WebApp1 and you want to access Picture1.jpg in the root directory, using that will return ~/Picture1.jpg

因此,如果您的应用程序托管在http:// localhost / WebApp1,并且您想要访问根目录中的Picture1.jpg,则使用它将返回〜/ Picture1.jpg

string _directoryName = Request.AppRelativeCurrentExecutionFilePath + "Picture1.jpg" will return http://localhost/WebApp1/Picture1.jpg

string _directoryName = Request.AppRelativeCurrentExecutionFilePath +“Picture1.jpg”将返回http://localhost/WebApp1/Picture1.jpg