Groups | Blog | Home
all groups > asp.net > july 2004 >

asp.net : Question: "Access to path denied" message


VB Programmer
7/13/2004 11:09:50 PM
When I run this line:

Dim sw As New System.IO.StreamWriter(strFileName)

I get this error:

System.UnauthorizedAccessException: Access to the path
"c:\inetpub\wwwroot\MyWeb\Resources\Templates\MyPage.Html" is denied. at
System.IO.__Error.WinIOError(Int32 errorCode, String str) at
System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access,
FileShare share, Int32 bufferSize, Boolean useAsync, String msgPath, Boolean
bFromProxy) at System.IO.FileStream..ctor(String path, FileMode mode,
FileAccess access, FileShare share, Int32 bufferSize) at
System.IO.StreamWriter.CreateFile(String path, Boolean append) at
System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding,
Int32 bufferSize) at System.IO.StreamWriter..ctor(String path) at
EarlyAlert3.EditHtml.cmdSave_Click(Object sender, EventArgs e) in
c:\inetpub\wwwroot\MyWeb\EditHtml.aspx.vb:line 172

Any ideas?

Thanks.

VB Programmer
7/13/2004 11:16:00 PM
I gave the aspnet user account r/w/mod access to the dir and it worked.
Thanks.
[quoted text, click to view]

AddThis Social Bookmark Button