Re: Getting IIS Code base directory
From: donotspam (pankajchitriv_at_rediffmail.com(donotspam))
Date: 02/08/05
- Next message: Roland Hall: "Re: maybe OT ... does IIS run on win XP media edition?"
- Previous message: John Cesta: "Re: Replacing Windows 2000 Server with Windows 2003 Server Web Edition"
- In reply to: Kristofer Gafvert: "Re: Getting IIS Code base directory"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 8 Feb 2005 13:09:02 -0800
Thanks Kristofer and Grezegorz.
Well, it is not a asp.net app. Its a .Net remoting application. The simplest
way I got, to get the path is
Page pg = new Page();
string strAbsPath = pg.Server.MapPath(".") + "\\bin\\";
So unlike "HttpRequest" object creation, I don't have to bother abt any
parameters to get the physical path.
Thanks a lot any ways,
Pankaj A. Chitriv
"Kristofer Gafvert" wrote:
> Hi,
>
> I think that what you are looking for is the HttpRequest.MapPath method
>
> Here's a link to the MSDN documentation:
>
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwebhttprequestclassmappathtopic.asp
>
> Hope this helps!
>
>
> --
> Regards,
> Kristofer Gafvert
> www.gafvert.info - My Articles and help
> www.ilopia.com
>
>
> Pankaj wrote:
>
> > Hi,
> > I'm in the situation where I want to get the absolute path of IIS code
> base
> > directory (i.e. typically <website name>\bin ), without passing the
> website
> > (virtual directory) name.
> >
> > As the default current directory (or working directory) for the IIS is
> > "C:\WINNT\system32\inetsrv", the "Directory.GetCurrentDirectory()" method
> > always returns "C:\WINNT\system32\inetsrv" and not the path where actual
> > binary files of the website are residing.
> >
> > Can anybody help me by telling how do I get the absolute path of the
> > directory "without passing the website name" ?
> >
> > Thanks in advance
> > Pankaj A. Chitriv
>
- Next message: Roland Hall: "Re: maybe OT ... does IIS run on win XP media edition?"
- Previous message: John Cesta: "Re: Replacing Windows 2000 Server with Windows 2003 Server Web Edition"
- In reply to: Kristofer Gafvert: "Re: Getting IIS Code base directory"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|