Wednesday, March 28, 2012

System.IO.StreamWriter -- Access to path is denied

Hi, I am trying to use the System.IO.StreamWriter to write to a file, and am getting an error that I have to set permissions for doing this in IIS -- I don't remember how to do this. Does anyone know how?

(Win XP Pro)


System.IO.StreamWriter writer = new System.IO.StreamWriter(@dotnet.itags.org."C:\NetApplicationTest",true);
Hi, u need to add aspNet User to the folder u trying to accessing and give the account have the permission to write/read it in the folder or file.

If u cant see any security tab on ur folder option, do tis below in any folder:
Tools>Folder Options>View>uncheck this "use simple file sharing(Recommended)"

then go to ur file's folder , note: folder
right click then properties> Security>Add > Advance> Find now>
Then u select ASPNET and add it, and set ASPNET to full control.

Hope tis help
life's Ng
beauty, thanks very much! -- I guess that I should study some XP Admin stuff... thanks 'gain ..

0 comments:

Post a Comment