473,396 Members | 1,852 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,396 software developers and data experts.

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 1859
"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
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
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
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
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
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
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
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
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
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
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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
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...

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.