473,775 Members | 2,335 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help required, problems while reading in a file??( REPOST)

Hi all,

I have made an ASP.NET 1.1 application on windows 2000 advanced server.

In the application, i have saved the file using the following code
string str;
str="this is my data";
FileStream fs=new FileStream("myt xt.txt",FileMod e.open);
StreamWriter sr=new StreamWriter (fs);
sr.Write(str);
Now i can write the file and even read it on my system. It saves the
file in my C:\WINNT\System 32. Now my C Drive is FAT32. Please note that

name of my application is "MyWebProje ct".
Now i copy my project folder i.e. "MyWebProje ct" from wwwrooot and take

to other system and saves the file in other system that is running Win
XP which has IIS installed. I have made a virtual directory that maps
to the file i just copied from Win 2000. Please also note that C Drive
of Win XP is NTFS.
Now when i try to run my application on Win XP, it throws an error
which is as following
---------------------------------------------------------------------------*-----------------------------------------

Access to the path "C:\WINDOWS\sys tem32\mytxt.txt " is denied.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.
---------------------------------------------------------------------------*-----------------------------------------

Now please let me know what i am doing wrong here, if i have to set
some seucrity permissions within my XP machine then please let me know
how should i go about it?
OR if there is some other error then please let me know what it is....
I appreciate your time and thanks in advance.
-Erland

Apr 12 '06 #1
2 1125
Do you really want your web application to write to the system32 directory??
Is this an anonymous web site? If so, you'll need to give the IUSR_ account
(or ASPNET) account WRITE access to the system32 directory!

Jeff

"Erland" <Er************ @gmail.com> wrote in message
news:11******** **************@ z34g2000cwc.goo glegroups.com.. .
Hi all,

I have made an ASP.NET 1.1 application on windows 2000 advanced server.

In the application, i have saved the file using the following code
string str;
str="this is my data";
FileStream fs=new FileStream("myt xt.txt",FileMod e.open);
StreamWriter sr=new StreamWriter (fs);
sr.Write(str);
Now i can write the file and even read it on my system. It saves the
file in my C:\WINNT\System 32. Now my C Drive is FAT32. Please note that

name of my application is "MyWebProje ct".
Now i copy my project folder i.e. "MyWebProje ct" from wwwrooot and take

to other system and saves the file in other system that is running Win
XP which has IIS installed. I have made a virtual directory that maps
to the file i just copied from Win 2000. Please also note that C Drive
of Win XP is NTFS.
Now when i try to run my application on Win XP, it throws an error
which is as following
---------------------------------------------------------------------------*-----------------------------------------

Access to the path "C:\WINDOWS\sys tem32\mytxt.txt " is denied.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.
---------------------------------------------------------------------------*-----------------------------------------

Now please let me know what i am doing wrong here, if i have to set
some seucrity permissions within my XP machine then please let me know
how should i go about it?
OR if there is some other error then please let me know what it is....
I appreciate your time and thanks in advance.
-Erland
Apr 12 '06 #2
Completely bad ju-ju in there, Boss. Don't do it. No. What problem are you
trying to solve by doing this?

"Erland" wrote:
Hi all,

I have made an ASP.NET 1.1 application on windows 2000 advanced server.

In the application, i have saved the file using the following code
string str;
str="this is my data";
FileStream fs=new FileStream("myt xt.txt",FileMod e.open);
StreamWriter sr=new StreamWriter (fs);
sr.Write(str);
Now i can write the file and even read it on my system. It saves the
file in my C:\WINNT\System 32. Now my C Drive is FAT32. Please note that

name of my application is "MyWebProje ct".
Now i copy my project folder i.e. "MyWebProje ct" from wwwrooot and take

to other system and saves the file in other system that is running Win
XP which has IIS installed. I have made a virtual directory that maps
to the file i just copied from Win 2000. Please also note that C Drive
of Win XP is NTFS.
Now when i try to run my application on Win XP, it throws an error
which is as following
---------------------------------------------------------------------------Â*-----------------------------------------

Access to the path "C:\WINDOWS\sys tem32\mytxt.txt " is denied.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.
---------------------------------------------------------------------------Â*-----------------------------------------

Now please let me know what i am doing wrong here, if i have to set
some seucrity permissions within my XP machine then please let me know
how should i go about it?
OR if there is some other error then please let me know what it is....
I appreciate your time and thanks in advance.
-Erland

Apr 13 '06 #3

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

Similar topics

14
3176
by: deko | last post by:
Do I need to use flock() when reading a file into an array? It's possible that the file in question could be open at the time the file('filename') request is made. I realize flock() is required when opening a file with fopen() when there is contention for the file: $fp=fopen($ctr, 'w'); //only write if we can get lock on file if (flock($fp, LOCK_EX)) { fwrite($fp, "0");
12
4912
by: Anna | last post by:
Hi all, I posted the same question this afternoon but my message isn't showing up, so I thought I'd give it another try.... in case you should see it later I apologize for posting the same question twice! Here it is: I am having problems reading the value of a text Node. I think it has to do with the fact that the text is in a <span> tag. I have a table and in each <td> I have text + a checkbox. I want to retreive the text next to the...
1
3365
by: stuart dent via .NET 247 | last post by:
XML validation error. Help required If anyone can help me, thankyou, thankyou... When I run this code code I get this error: The data at the root level is invalid. Line 1, position 39. I can't work out what the error is. Can you??? original code: Dim oRead As XmlTextReader
3
2463
by: Alex Clark | last post by:
Hi All, I'm having some problems reading a network stream. I'm writing a lightweight POP client to handle a very specific task, but I keep unexpectedly reaching the end of the datastream when downloading a large-ish email (about 10K). This happens about 50% of the time when trying to download a large email from my POP server. I've tried telnet'ing into the POP server and manually issuing commands, and it works perfectly --- the...
6
2183
by: saleemahmad70 | last post by:
Hi.. I am stuck with a problem where I need to extract some information from a File in C++.e.g File size,date of creation, Location on the Disk etc. I haven't been able to find any particular solution yet. Could anybody amongst you help me in this regard. I'll be glad. Regards; Saleem
3
1740
by: katz911 | last post by:
Hello, I've encountered a strange problem which I can't seem to explain. I've written a simple C++ class that deals with a certian binary file. In one of the methods there, I wish to update a file - namely to read a certain field whose offset I know, and then write to another field, whose offset I also know. In order to read the data, I first use file.seekg(offset, ios::beg), and then a read command; I've checked the variable, and...
3
2185
by: miss time | last post by:
Hi all, my java friends ^-^ I have next week quiz in reading file text ,and understand the topic very well. can any one give some question related to this topic .this help me more to understand thanks a lot and sorry for inconvenience..
1
2142
Coldfire
by: Coldfire | last post by:
Hi, The strange problem i am having is, the input element of type='file' not reading file names after 20 file elements. It simple returns null on reading the 'name' of file. The code is simple and has no error as I am testing it standalone
1
2225
by: bjoarn | last post by:
I have an Application C# handling file reading, building index on this file, using dll wrapped with SWIG. The dll is originaly programmed in C++. Dll reports back to the the C# programm throug callback/delegates. Among others, it reports index building(%). One callback function can receive (stop order) to stop reading file/building index. How ever i do not know how to keep the stopbutton activ while this file reading is going on. I have...
0
9621
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10267
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10046
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
9915
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5358
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5484
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4014
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
3
2852
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.