writing XML file error

Discussion in 'ASP .Net' started by Salim Afþar, Jul 21, 2003.

  1. Salim Afþar

    Salim Afþar Guest

    Hi,
    I get an error (Access to the path "C:\Inetpub\wwwroot\LE\SMS\Mesaj_One.xml"
    is denied.) when I do this:
    string filename =Request.PhysicalApplicationPath.ToString() +
    "/Mesaj_One.xml";
    FileStream myFileStream = new FileStream(filename,
    System.IO.FileMode.Create);
    XmlTextWriter myXmlWriter = new XmlTextWriter(myFileStream,
    System.Text.Encoding.Unicode);
    dsWrite.WriteXml(myXmlWriter);

    Any idea please,
    Thanks in advence,
    Salim
     
    Salim Afþar, Jul 21, 2003
    #1
    1. Advertising

  2. The account under which your application is running doesn't have the
    necessary permission.
    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    ..Net Developer
    http://www.takempis.com
    Big things are made up of
    lots of little things.

    "Salim Afþar" <> wrote in message
    news:...
    > Hi,
    > I get an error (Access to the path

    "C:\Inetpub\wwwroot\LE\SMS\Mesaj_One.xml"
    > is denied.) when I do this:
    > string filename =Request.PhysicalApplicationPath.ToString() +
    > "/Mesaj_One.xml";
    > FileStream myFileStream = new FileStream(filename,
    > System.IO.FileMode.Create);
    > XmlTextWriter myXmlWriter = new XmlTextWriter(myFileStream,
    > System.Text.Encoding.Unicode);
    > dsWrite.WriteXml(myXmlWriter);
    >
    > Any idea please,
    > Thanks in advence,
    > Salim
    >
    >
     
    Kevin Spencer, Jul 21, 2003
    #2
    1. Advertising

  3. Hi
    Give ASP.NET User Account write permission on the web
    folder where you would like to create xml file.

    Ravikanth


    >-----Original Message-----
    >Hi,
    >I get an error (Access to the

    path "C:\Inetpub\wwwroot\LE\SMS\Mesaj_One.xml"
    >is denied.) when I do this:
    >string filename =Request.PhysicalApplicationPath.ToString

    () +
    >"/Mesaj_One.xml";
    >FileStream myFileStream = new FileStream(filename,
    >System.IO.FileMode.Create);
    >XmlTextWriter myXmlWriter = new XmlTextWriter

    (myFileStream,
    >System.Text.Encoding.Unicode);
    >dsWrite.WriteXml(myXmlWriter);
    >
    >Any idea please,
    >Thanks in advence,
    >Salim
    >
    >
    >.
    >
     
    Ravikanth[MVP], Jul 21, 2003
    #3
  4. Salim Afþar

    Jan Guest

    "Ravikanth[MVP]" <> skrev i meddelandet
    news:07ae01c34f85$c2a39150$...
    > Hi
    > Give ASP.NET User Account write permission on the web
    > folder where you would like to create xml file.


    How do you do that in WinXP Pro??? I can not find any security/access
    property settings.

    Jan

    >
    > Ravikanth
    >
    >
    > >-----Original Message-----
    > >Hi,
    > >I get an error (Access to the

    > path "C:\Inetpub\wwwroot\LE\SMS\Mesaj_One.xml"
    > >is denied.) when I do this:
    > >string filename =Request.PhysicalApplicationPath.ToString

    > () +
    > >"/Mesaj_One.xml";
    > >FileStream myFileStream = new FileStream(filename,
    > >System.IO.FileMode.Create);
    > >XmlTextWriter myXmlWriter = new XmlTextWriter

    > (myFileStream,
    > >System.Text.Encoding.Unicode);
    > >dsWrite.WriteXml(myXmlWriter);
    > >
    > >Any idea please,
    > >Thanks in advence,
    > >Salim
    > >
    > >
    > >.
    > >
     
    Jan, Jul 21, 2003
    #4
  5. If you're running XP Pro and your computer is not a member of a domain, you
    need to go into Control Panel, Folder Options. In the View tab, uncheck "Use
    Simple File Sharing" and you will be able to see the Security tab in your
    Folder Properties dialog boxes.

    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    ..Net Developer
    http://www.takempis.com
    Big things are made up of
    lots of little things.

    "Jan" <> wrote in message
    news:%...
    >
    > "Ravikanth[MVP]" <> skrev i meddelandet
    > news:07ae01c34f85$c2a39150$...
    > > Hi
    > > Give ASP.NET User Account write permission on the web
    > > folder where you would like to create xml file.

    >
    > How do you do that in WinXP Pro??? I can not find any security/access
    > property settings.
    >
    > Jan
    >
    > >
    > > Ravikanth
    > >
    > >
    > > >-----Original Message-----
    > > >Hi,
    > > >I get an error (Access to the

    > > path "C:\Inetpub\wwwroot\LE\SMS\Mesaj_One.xml"
    > > >is denied.) when I do this:
    > > >string filename =Request.PhysicalApplicationPath.ToString

    > > () +
    > > >"/Mesaj_One.xml";
    > > >FileStream myFileStream = new FileStream(filename,
    > > >System.IO.FileMode.Create);
    > > >XmlTextWriter myXmlWriter = new XmlTextWriter

    > > (myFileStream,
    > > >System.Text.Encoding.Unicode);
    > > >dsWrite.WriteXml(myXmlWriter);
    > > >
    > > >Any idea please,
    > > >Thanks in advence,
    > > >Salim
    > > >
    > > >
    > > >.
    > > >

    >
    >
     
    Kevin Spencer, Jul 21, 2003
    #5
    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. John Carnahan

    File Access error - writing to .txt file

    John Carnahan, Jul 18, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    805
    John Carnahan
    Jul 18, 2003
  2. HNguyen
    Replies:
    4
    Views:
    2,410
    HNguyen
    Dec 21, 2004
  3. Christopher Boomer
    Replies:
    0
    Views:
    410
    Christopher Boomer
    Jul 28, 2003
  4. jkflens
    Replies:
    2
    Views:
    1,498
    jkflens
    May 30, 2006
  5. Erik Wasser
    Replies:
    5
    Views:
    465
    Peter J. Holzer
    Mar 5, 2006
Loading...

Share This Page