'Access to path 'x' is denied' message when creating file
i have a simple web project that has one row :
File.Create(Server.MapPath(".") + "\asaf.txt").Close();
it creates a blank text file in the project folder, thats it.
it works fine in the VS2010 , but after i created a virtual directory in the IIS that points to this project folder and 'Browse' the default.aspx file f开发者_JAVA技巧rom teh IIS. i get :
"Access to the path 'C:\Documents and Settings\Asaf\My Documents\Visual Studio 2010\Projects\TestApp\TestApp\asaf.txt' is denied."
- the ASP.NET version is ok.
- the Anonymous Access check box is checked (it was like that already)
- the "integrated windows authentication" is checked too.
- i gave all permissions in the vitual directory properties: read ,write, script source access, directory browsing... it doesn't help.
at my workplace i went to the folder properties and gave full control and it solved the problem but when i get inside the properties of folder on my home computer I CAN'T FIND IT ANYWHERE , where is the "full control" screen? and how do i solve the problem ?
ok , solved it , if the "Security" tab doesn't show on your folder properties,
- open the explorer
- go to Tools --> folder options --> view tab
- unmarked the property : "use simple file sharing". (one of the last properties.
- open the folder property again , go to the security tab and give Full Control to "Everyone".
精彩评论