Help Required( Repost)

X

xRAM.tech

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
 
W

Winista

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).


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
 

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,773
Messages
2,569,594
Members
45,114
Latest member
GlucoPremiumReview
Top