how to get application name and path programmatically

B

buran

Dear ASP.NET Programmers,

How can I get the name of my application programmatically? Also the path of
the application. For instance, if my application is named "buran" and
located in c:\inetpub\wwwroot\buran directory, how can get them? Thanks in
advance,

Buran
 
G

Guest

To get the name of the application use:
HttpContext.Current.Request.ApplicationPath.Substring(1,
Request.ApplicationPath.Length-1)

If you want to get the application name alone, then the above gets rid of '/'

Hope this helps!

Rajesh Meenrajan
MCSD.net
http://meenrajan.blogspot.com
 
B

buran

Thank you Brock and Rajesh :)



Rajesh said:
To get the name of the application use:
HttpContext.Current.Request.ApplicationPath.Substring(1,
Request.ApplicationPath.Length-1)

If you want to get the application name alone, then the above gets rid of '/'

Hope this helps!

Rajesh Meenrajan
MCSD.net
http://meenrajan.blogspot.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,825
Latest member
VernonQuy6

Latest Threads

Top