473,324 Members | 2,581 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,324 software developers and data experts.

ASP.NET Current directory

I am testing the ASP.NET in VS 2005 IDE.
My webiste is on:
c:\test\website1

I have a directory called documents in the website directory
c:\test\website1\documents

I want to reference our documents in this directory by using
Path.GetFullPath("documents");

If I run the website by pressing F5, it shows the path of the documents
directory as
C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\documents

How do I know if it is correct when the website is running on the live site?

I cannot run the default.aspx in my browser because I got the problem:
I installed VS2003 after VS2005 so I need to run VS2005 IDE.
Mar 5 '07 #1
2 5475
tee
Hi Alan,

Have you tried

string sFullpath = Server.MapPath("documents");
Response.Write(sFullpath);


"Alan T" <al*************@yahoo.com.auwrote in message
news:uf**************@TK2MSFTNGP04.phx.gbl...
>I am testing the ASP.NET in VS 2005 IDE.
My webiste is on:
c:\test\website1

I have a directory called documents in the website directory
c:\test\website1\documents

I want to reference our documents in this directory by using
Path.GetFullPath("documents");

If I run the website by pressing F5, it shows the path of the documents
directory as
C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\documents

How do I know if it is correct when the website is running on the live
site?

I cannot run the default.aspx in my browser because I got the problem:
I installed VS2003 after VS2005 so I need to run VS2005 IDE.

Mar 5 '07 #2
Sorry, what namespace should I include in the using to include the "Server"?

"tee" <kh**********@yahoo.comwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
Hi Alan,

Have you tried

string sFullpath = Server.MapPath("documents");
Response.Write(sFullpath);


"Alan T" <al*************@yahoo.com.auwrote in message
news:uf**************@TK2MSFTNGP04.phx.gbl...
>>I am testing the ASP.NET in VS 2005 IDE.
My webiste is on:
c:\test\website1

I have a directory called documents in the website directory
c:\test\website1\documents

I want to reference our documents in this directory by using
Path.GetFullPath("documents");

If I run the website by pressing F5, it shows the path of the documents
directory as
C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\documents

How do I know if it is correct when the website is running on the live
site?

I cannot run the default.aspx in my browser because I got the problem:
I installed VS2003 after VS2005 so I need to run VS2005 IDE.


Mar 5 '07 #3

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

Similar topics

12
by: EAS | last post by:
Does anyone know how to display the current directory using DOS and/or Python? I already tried os.pardir and os.curdir in Python, but all they return are a couple of periods... >>>import os...
3
by: Daniel | last post by:
How do you get the current directory of the actual .exe file (not the file name but the directory it is in) ? These do not work: System.IO.Directory.GetCurrentDirectory() - returns system...
11
by: kk | last post by:
Can any function tell the compiled program executing path? after using the program to open a file from MFC dialog box, the path changes. thks in advance.
3
by: Alur | last post by:
Changing the current directory with the help of dialog window(MFC app) We can change directory with the help of the following code: CFileDialog m_ldFile(TRUE);...
3
by: Progman | last post by:
I use Visual Studio 2005 When I run msgbox Curdir(), I get the visual studio directory. This problem seems to be only in the VB part. In the ASP, we use ~/etc... to access files. Why I...
3
by: Chris Mellon | last post by:
This appears to be a change in behavior from Python 2.4 to Python 2.5, which I can't find documented anywhere. It may be windows only, or related to Windows behavior. In 2.4, the current...
6
by: titan.nyquist | last post by:
The WebBrowser control won't load a css file written in the same directory as the program. If I put an absolute path to it, it will load it. Thus, the current directory of the WebBrowser control...
11
by: greg | last post by:
Hi all, Is there a way to get the current theme name at design time? I'm trying to write a custom control for which I need to use images from the current theme. I have asigned a theme to the...
3
by: duyanning | last post by:
I have written a pyhton script that will process data file in current working directory. My script is in an different directory to data file. When I debug this script using pdb within emacs, emacs...
2
by: Kakkanattu | last post by:
Hi, In desktop application, we use different ways to get the current execution directory. I. AppDomain.CurrentDomain.BaseDirectory II. Environment.CurrentDirectory...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.