Question: "Access to path denied" message

Discussion in 'ASP .Net' started by VB Programmer, Jul 14, 2004.

  1. 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, Jul 14, 2004
    #1
    1. Advertising

  2. 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:...
    > 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, Jul 14, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kevin Quigley

    Access to path denied error.

    Kevin Quigley, Dec 17, 2003, in forum: ASP .Net
    Replies:
    6
    Views:
    4,774
    Kevin Quigley
    Jan 5, 2004
  2. =?Utf-8?B?bWc=?=
    Replies:
    1
    Views:
    2,201
    Marshal Antony
    Feb 8, 2004
  3. bb
    Replies:
    2
    Views:
    2,689
  4. Bryan

    Access to path denied

    Bryan, May 18, 2004, in forum: ASP .Net Security
    Replies:
    0
    Views:
    127
    Bryan
    May 18, 2004
  5. George Hardy

    Access to path **** denied.

    George Hardy, Aug 23, 2005, in forum: ASP .Net Security
    Replies:
    7
    Views:
    180
Loading...

Share This Page