473,503 Members | 1,650 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

it always return path C:\winnt\system32 ..why ?

Hi,

can anybody tell me why
the following piece of code in my ASP.NET page always returns the path
as C:\winnt\system32 ?

FileInfo objf = new FileInfo("test.xml");
string strFile = objf.DirectoryName;
Thanks
Raagz
Nov 18 '05 #1
2 1864
"raagz" <ra*****@yahoo.com> wrote in message
news:e1**************************@posting.google.c om...
Hi,

can anybody tell me why
the following piece of code in my ASP.NET page always returns the path
as C:\winnt\system32 ?

FileInfo objf = new FileInfo("test.xml");
string strFile = objf.DirectoryName;


Because that's the default directory of the aspnet_wp process.
--
John Saunders
johnwsaundersiii at hotmail
Nov 18 '05 #2
Ben
Look at Server.MapPath() maybe that will help??
"raagz" <ra*****@yahoo.com> wrote in message
news:e1**************************@posting.google.c om...
Hi,

can anybody tell me why
the following piece of code in my ASP.NET page always returns the path
as C:\winnt\system32 ?

FileInfo objf = new FileInfo("test.xml");
string strFile = objf.DirectoryName;
Thanks
Raagz


Nov 18 '05 #3

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

Similar topics

5
1848
by: Gernold Schneider | last post by:
I have a managed code function calling a unmanaged code function which returns a "bool". Obviously the return value is always "true", if i am not running the code in the debugger. If i run the...
0
257
by: raagz | last post by:
Hi, can anybody tell me why the following piece of code in my ASP.NET page always returns the path as C:\winnt\system32 ? FileInfo objf = new FileInfo("test.xml"); string strFile =...
12
3766
by: Michael Maes | last post by:
Hello, I have a BaseClass and many Classes which all inherit (directly) from the BaseClass. One of the functions in the BaseClass is to (de)serialize the (inherited) Class to/from disk. ...
16
4870
by: Dany | last post by:
Our web service was working fine until we installed .net Framework 1.1 service pack 1. Uninstalling SP1 is not an option because our largest customer says service packs marked as "critical" by...
3
3739
by: peter | last post by:
I have a weird problem in some code I am writing. The user selects a number of files from a list and then can select an option which will rename the selected files. Before the process starts, a...
9
2368
by: dba123 | last post by:
what's the best way to check the incoming URL for an IDand return the ID possible examples of incoming URLs: /somedirectory/4/somepage.aspx /somedirectory/4.aspx // Check requested URL for ID...
12
4520
by: snow | last post by:
Hi All, I noticed if file path has a white space, for example "C:\my document \test.txt", the function File.Exists(filePath) always return false in release mode. How could I make this function...
2
3151
by: mlevit | last post by:
Hi, I've written my own JavaScript and used a couple of codes to set and get cookies from the net I found. When I set the cookie I can see it in my browser, it is set with the right value and...
1
9691
by: Kerem Gümrükcü | last post by:
Hi, i try to create a remote process with Win32_Process.Create, but the remote machine always retruns 9 as result, which say that the path could not be found. Code seems to be fine, except the...
0
7201
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7083
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...
1
6988
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...
0
5578
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,...
1
5011
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...
0
3166
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...
0
3153
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1510
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 ...
1
734
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.