Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Question: "Access to path denied" message

Reply
Thread Tools

Question: "Access to path denied" message

 
 
VB Programmer
Guest
Posts: n/a
 
      07-14-2004
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\MyPa ge.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.


 
Reply With Quote
 
 
 
 
VB Programmer
Guest
Posts: n/a
 
      07-14-2004
I gave the aspnet user account r/w/mod access to the dir and it worked.
Thanks.
"VB Programmer" <Dont*NoSpam-Please*@jEmail.com> wrote in message
news:(E-Mail Removed)...
> 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\MyPa ge.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.
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Server.MapPath() croaking with "failed to map path", but path is legal awbacker@gmail.com ASP .Net 0 05-12-2005 10:50 PM
how to get application path? Is that my method in getting path wrong? James Java 2 12-07-2004 11:59 AM
absolute path versus relative path in JSP Matt Java 3 07-08-2004 08:31 PM
Bizzare: Invalid path to Access mdb, path is good Keith-Earl ASP .Net 1 05-03-2004 03:25 PM
Tomcat returning 404 error when using additional path (/servlet/myServlet/extra/path/info) Mupota Muchelemba Java 1 02-04-2004 12:43 AM



Advertisments