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

E

Erland

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
 
J

Jeff Dillon

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

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
 
G

Guest

Completely bad ju-ju in there, Boss. Don't do it. No. What problem are you
trying to solve by doing this?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top