473,396 Members | 1,722 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 1860
"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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
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
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...
0
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...
0
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
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,...

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.