如何查找在ASP.NET应用程序的路径 [英] How to locate a path in ASP.NET application

查看:118
本文介绍了如何查找在ASP.NET应用程序的路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在ASP.NET应用程序查找机(虚拟路径)上占有一席之地,

How to locate a place on a machine(virtual path) in an ASP.NET APPLICATION,

问题是这样的,在我们已经在debug文件夹中的.exe所以可以参照比较其他文件.exe文件如.. \\资源意味着上的.exe的一个文件夹有一个种源文件夹,如果我想窗口或桌面应用程序做同样的Web应用程序如何做到这一点。

the problem is this, In windows or desktop application we have .exe in debug folder so can refer other files relatively to .exe like ..\resources mean one folder upper of .exe there is a resouce folder, if i want to do the same in web application how to do that

推荐答案

在HttpContext的,你可以找到很多有用的特性

In the HttpContext you can find a lot of helpful properties

HttpRequest.ApplicationPath
HttpRequest.PhysicalApplicationPath
HttpRequest.PhysicalPath

和其他。

请参阅 http://msdn.microsoft。 COM / EN-US /库/ ms178116(v = VS.100)的.aspx
有一个很好的表,在页面的最后详细说明。

See http://msdn.microsoft.com/en-us/library/ms178116(v=vs.100).aspx There is a nice table with detailed explanations in the end of page.

这篇关于如何查找在ASP.NET应用程序的路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆