473,513 Members | 2,688 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

GetCurrentDirectory question

pb
I am using asp.net and have some code in a file in the App_Code
directory. I also have a text file in the same directory that I want
to access. This file will always br in the same directory but I will
not know the absolute path.

When I try...

Dim s As String = Directory.GetCurrentDirectory

I get

'c:\program files\microsoft visual studio 8\common7\IDE'

which is not the current directory of the code file that this is being
called from.

What am I missing?

Pb

Jun 17 '07 #1
1 1365

"pb" <ph**********@hotmail.comwrote in message
news:11*********************@n15g2000prd.googlegro ups.com...
>I am using asp.net and have some code in a file in the App_Code
directory. I also have a text file in the same directory that I want
to access. This file will always br in the same directory but I will
not know the absolute path.

When I try...

Dim s As String = Directory.GetCurrentDirectory

I get

'c:\program files\microsoft visual studio 8\common7\IDE'

which is not the current directory of the code file that this is being
called from.

What am I missing?
Mappath method in .Net Framework 2.0 and if it's .Net Framework 1.1, then
use Goole to find it out. I think it's MapServer in 1.1
Jun 17 '07 #2

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

Similar topics

3
4997
by: Stevey | last post by:
I have the following XML file... <?xml version="1.0"?> <animals> <animal> <name>Tiger</name> <questions> <question index="0">true</question> <question index="1">true</question> </questions>
3
3060
by: Ekqvist Marko | last post by:
Hi, I have one Access database table including questions and answers. Now I need to give answer id automatically to questionID column. But I don't know how it is best (fastest) to do? table before rowID answID qryrow questionID datafield 1591 12 06e 06e 06e question 1593 12 06f 06f 06f question 1594 12 answer to the question 06f
0
2029
by: Manfred Suttorp | last post by:
If I use the Directory.GetCurrentDirectory() method in the compact framework the app throws a System.NotSupportedException. The documentation on MSDN says it is supported on the compact framework. Now, is the method supported or not? -- Thanks in advance Manfred Suttorp
7
7155
by: Dan | last post by:
I have built a C# Windows application using a C# library hosted in a DLL. Both the library and the application need to access some files which at program installation are placed in the EXE's path; thus, I use Directory.GetCurrentDirectory() to initialize the default filenames so that they point to the EXE's path. This happens in the...
1
5636
by: | last post by:
Why ? void foo() { Directory::GetCurrentDirectory() ; } ----------Compile Error----------------------- C2039: 'GetCurrentDirectoryA' : is not a member of 'System::IO::Directory'
2
1797
by: poppy | last post by:
Whenever I use "Directory.getcurrentdirectory" I always get "C:\WINDOWS\system32" despite the fact that the code is running from a subdirectory of wwwroot. Can someone help ? How can I get the current directory on a code behind page ? I dont want the full "C:\e.t.c. Just the current directory name.
3
1730
by: Maileen | last post by:
Hi, I have a little trouble with the function "Directory.GetCurrentDirectory()". It seems that it keeps into memory the path of the Debug version of my application. It doesn't work correctly in Release version. Did anyone already have such problem ?
1
1669
by: Hasan O. | last post by:
Hi , I have a simple program thats open some file a.txt. When program starts it gets GetCurrentDirectory and finds / opens the a.txt file. But if i create a shortcut on desktop it couldnot find real working directory. How can i do this ? this is not working for shortcuts char buf; GetCurrentDirectory(2000, buf);
0
1353
by: JohnIdol | last post by:
Hi Guys, anyone could help me understand the difference between these two methods? path = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase.Replace("file:/", "")); path_Startup = System.IO.Directory.GetCurrentDirectory(); I am getting the same result.
0
7563
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7125
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
5703
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5102
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4757
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3252
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3239
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1612
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
470
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.