473,406 Members | 2,377 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,406 software developers and data experts.

Help Required( 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("mytxt.txt",FileMode.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\System32. Now my C Drive is FAT32. Please note that

name of my application is "MyWebProject".
Now i copy my project folder i.e. "MyWebProject" 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\system32\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
1 937
a web application is not allowed to read the files outside its virtual
folder unless it is given permisison to do so. You will have to give ASPNET
user account permisison to read files from the folder or write (if your
application needs to write the file).
<xR*******@gmail.com> wrote in message
news:11**********************@v46g2000cwv.googlegr oups.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("mytxt.txt",FileMode.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\System32. Now my C Drive is FAT32. Please note that

name of my application is "MyWebProject".
Now i copy my project folder i.e. "MyWebProject" 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\system32\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

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

Similar topics

2
by: jorntk | last post by:
if ((!isset( $PHP_AUTH_USER )) || (!isset($PHP_AUTH_PW))) { header( 'WWW-Authenticate: Basic realm="Private"' ); header( 'HTTP/1.0 401 Unauthorized' ); echo 'Authorization Required.'; exit; ...
6
by: Ciprian Ilie | last post by:
Hi there, If you look at the code below, you will see that I am using a template in order to display some photos on my website. I also have "previous" and "next" buttons/link which increment the...
4
by: Mike | last post by:
Please help this is driving me nuts. I have 2 forms, 1 user class and I am trying to implement a singleton class. Form 1 should create a user object and populate some properties in user. Form2...
3
by: Adam | last post by:
I've posted about this previously, but failed to receive a satisfactory response, so have included a code sample: I am trying to receive messages from an HTML viewer control in compact.net (c#),...
0
by: Doug | last post by:
This is a repost of an item that I still cannot resolve. I have 3 combo boxes. The first leads to the second to the third. When I have selected a value in the second box, the third box shows...
14
by: Steve McLellan | last post by:
Hi, Sorry to repost, but this is becoming aggravating, and causing me a lot of wasted time. I've got a reasonably large mixed C++ project, and after a number of builds (but not a constant...
5
by: Adrian Parker | last post by:
I've got the standard SqlCacheDependency working just fine , ie. I've defined (and encrypted) the connectionStrings section in the web.config, and I've also defined an an sqlCacheDependency in the...
1
by: D-Someone | last post by:
I am re-posting this message as originially it did not get a single response.. Any ideas? -------------- I am trying to come up with a good design for a web service that has some user logic...
0
by: Andrew Meador - ASCPA, MCSE, MCP+I, Network+, A+ | last post by:
I am running Access 2007. I have a report that I want to filter. I can go into Advanced...Advanced Filter/Sort... and setup a filter that works fine on the report when I apply it. When in this...
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
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
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,...
0
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...

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.