Problem about access denied .
This is my test code:
string desfile=Server.MapPath("/Text/test.txt");
StreamWriter sw=new StreamWriter(desfile,false);
sw.WriteLine("Line1\n\rLine2\n\rLine3");
sw.Close();
when I run these code it return this error message:
"Accecc to c:/inetpub/wwwroot/Test/text/test.txt is denied".
I solved it by setting the directory security of the Test and Text subfolder to read and write and allow annonymous access but it still didn't work. Finally I set the asp.net user accoount to Administrator account then it worked.Is there any better method than this ? I am afraid that this will allow too much permission to the annonymous user.Please give me the suggestion.
doctorsom
|