473,408 Members | 1,821 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Application directory

Hello C#ers

I need to know how to find out the application's path from a web
application. By application path I understand:
if my ISAPI is placed on http://localhost/mydir, I want
c:\Inetpub\wwwroot\mydir or even http://localhost/mydir, eather one is
good.
Can this be done ? Help please!

Thanks for all the answers that will hopefully follow :)))
Christina Androne
Nov 15 '05 #1
2 5207
"Christina Androne" <ac********@NotAtHome.ro> wrote in message
news:e8*************@TK2MSFTNGP11.phx.gbl
Hello C#ers

I need to know how to find out the application's path from a web
application. By application path I understand:
if my ISAPI is placed on http://localhost/mydir, I want
c:\Inetpub\wwwroot\mydir or even http://localhost/mydir, eather one is
good.
Can this be done ? Help please!


I've had success using this:

string AppPath=Request.ServerVariables["PATH_TRANSLATED"]; // path to aspx
file
int k=AppPath.LastIndexOf("\\");
AppPath=AppPath.Substring(0,k+1); // strip off file name

--
C# newbie... posts are probably inaccurate, inelegant or both

Nov 15 '05 #2
Bill Styles wrote:

I've had success using this:

string AppPath=Request.ServerVariables["PATH_TRANSLATED"]; // path
to aspx file
int k=AppPath.LastIndexOf("\\");
AppPath=AppPath.Substring(0,k+1); // strip off file name


Yes, but I am not in an ASP.NET application :(. I am in a plain ISAPI
dll (please do not ask why :) ). I want to know the path to it. In a
normaly ISPAI I would use GetModuleFileName but in the NET framework
it's not working, it is not returning the correct path.

Christina Androne.

Nov 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Dennis | last post by:
Hi, I am wondering that the Application Name in Virtual Directory is compulsory be non-empty field when configuring Virtual Directory for ASP.NET application? I realized some of my ASP.NET...
5
by: Leszek | last post by:
Hello, Could anybody explain what's a difference between a virtual directory and an application root under IIS? I'm a little bit confused. This is mu problem: Let's assume the following...
9
by: Wayne Wengert | last post by:
I built an ASP application and it runs fine on my local IIS. I am trying to move the application to my web service (ISP) out on the internet. I've read several of the help articles but they all...
10
by: Steve Taylor | last post by:
I am having trouble understanding the ASP.NET application boundaries. Here's my setup: 1. Win2003 Server with IIS 6 and an application defined at the root "SalesNow" (www.salesnow.com). 2. A...
21
by: Chris | last post by:
I'm trying to get an existing VS.NET project up on my Win2003 server and I get the following error (on the actual website page): "It is an error to use a section registered as...
9
by: Andy Sutorius | last post by:
Hi, Do you always have to make a folder an application if you have a web.config in that folder? Thanks, Andy
6
by: Martin Bischoff | last post by:
Hi, I'm creating temporary directories in my web app (e.g. ~/data/temp/temp123) to allow users to upload files. When I later delete these directories (from the code behind), the application...
7
by: Rabbit | last post by:
Dear all, Does anyone know how to resolve following setup problem, I developed my application(using .net 2.0) which will connect Access database on my Win XP, everything works fine, but when I...
5
by: Oriane | last post by:
Hi, I'm developinf an Asp.Net 3.5 site on W2k3, and I use a Web application Visual Studio 2008 project. This Web app is configured on IIS 6 as an "application" under a web site. When I start...
1
by: =?Utf-8?B?RmFtaWx5IFRyZWUgTWlrZQ==?= | last post by:
For in-house tools, the approach of writing to the program files folder is fine. Here are a few ways that it can be problematic if the code goes out of your team, such as to a customer: 1....
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.