Yogesh
Yogesh

Reputation: 3076

How to locate a path in ASP.NET application

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

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

Upvotes: 0

Views: 216

Answers (1)

Anri
Anri

Reputation: 6265

In the HttpContext you can find a lot of helpful properties

HttpRequest.ApplicationPath
HttpRequest.PhysicalApplicationPath
HttpRequest.PhysicalPath

and others.

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.

Upvotes: 2

Related Questions