Home All Groups Group Topic Archive Search About

how to get application name and path programmatically

Author
11 Jun 2005 1:46 PM
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

Author
11 Jun 2005 2:07 PM
Brock Allen
Request.PhysicalApplicationPath

-Brock
DevelopMentor
http://staff.develop.com/ballen



Show quoteHide quote
> 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
>
Are all your drivers up to date? click for free checkup

Author
12 Jun 2005 12:36 AM
Rajesh
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


Show quoteHide quote
"Brock Allen" wrote:

> Request.PhysicalApplicationPath
>
> -Brock
> DevelopMentor
> http://staff.develop.com/ballen
>
>
>
> > 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
> >
>
>
>
>
Author
13 Jun 2005 8:24 AM
buran
Thank you Brock and Rajesh :)



Show quoteHide quote
"Rajesh" <Raj***@discussions.microsoft.com> wrote in message
news:13466821-7C89-4E8C-B040-E0119E4ACB00@microsoft.com...
> 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
>
>
> "Brock Allen" wrote:
>
> > Request.PhysicalApplicationPath
> >
> > -Brock
> > DevelopMentor
> > http://staff.develop.com/ballen
> >
> >
> >
> > > 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
> > >
> >
> >
> >
> >

Bookmark and Share