Solved

path of project

Posted on 2011-09-16
4
312 Views
Last Modified: 2012-06-22
I have project that is a WEB site and not a WEB application.  A WEB site, since it is compiled on the fly, does not have a "My Project' folder and thus does not have access to the My.Application object.

So, I want to get the path of the root of my application.  I want to access custom text files that reside there as part of my app.  
0
Comment
Question by:HLRosenberger
4 Comments
 
LVL 10

Expert Comment

by:Mez4343
ID: 36550720
did you try
Application.StartupPath
0
 
LVL 28

Accepted Solution

by:
strickdd earned 500 total points
ID: 36550733
Server.MapPath is what you want.

Server.MapPath("/MySiteFolder/Folder/")

Open in new window


The more specific the better, for example specify a filename at the end.
0
 
LVL 51

Expert Comment

by:HainKurt
ID: 36550802

try these...

Server.MapPath("/")
Server.MapPath("~")
Server.MapPath("~/")
Server.MapPath(".")

0
 
LVL 1

Author Closing Comment

by:HLRosenberger
ID: 36550828
That did the trick!  Thanks
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question