Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. XMLTextWriter question

XMLTextWriter question

Scheduled Pinned Locked Moved C#
xmlquestion
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    LCI
    wrote on last edited by
    #1

    I have a web service listener that has a function that generates an XML file. For some reason, it cannot get past the line of code below with the asterix string xmlFilename = string.Format ("C:\\{0}.xml", m_Tag); XmlTextWriter writer = null; writer = new XmlTextWriter(xmlFilename,System.Text.Encoding.UTF8);***************************** writer.Formatting = Formatting.Indented; writer.WriteStartDocument (); This code works fine on my form application. Is there something i am missing. Any input is appreciated. Thanks, Colin

    R L 2 Replies Last reply
    0
    • L LCI

      I have a web service listener that has a function that generates an XML file. For some reason, it cannot get past the line of code below with the asterix string xmlFilename = string.Format ("C:\\{0}.xml", m_Tag); XmlTextWriter writer = null; writer = new XmlTextWriter(xmlFilename,System.Text.Encoding.UTF8);***************************** writer.Formatting = Formatting.Indented; writer.WriteStartDocument (); This code works fine on my form application. Is there something i am missing. Any input is appreciated. Thanks, Colin

      R Offline
      R Offline
      roel_v
      wrote on last edited by
      #2

      Most probably a security issue... your webservice listener must be running under a user account (ASPNET?) that does not have permission to write to the root of you c:\ drive. Roel

      L 1 Reply Last reply
      0
      • R roel_v

        Most probably a security issue... your webservice listener must be running under a user account (ASPNET?) that does not have permission to write to the root of you c:\ drive. Roel

        L Offline
        L Offline
        LCI
        wrote on last edited by
        #3

        That is a good possiblity. However, i wrote to a regualr txt file using stream writer and i was able to write to a folder on my root. So is it safe to say that if i could write to C:\MyFolder, that i should be able to write to the root directly i.e. C:\??

        1 Reply Last reply
        0
        • L LCI

          I have a web service listener that has a function that generates an XML file. For some reason, it cannot get past the line of code below with the asterix string xmlFilename = string.Format ("C:\\{0}.xml", m_Tag); XmlTextWriter writer = null; writer = new XmlTextWriter(xmlFilename,System.Text.Encoding.UTF8);***************************** writer.Formatting = Formatting.Indented; writer.WriteStartDocument (); This code works fine on my form application. Is there something i am missing. Any input is appreciated. Thanks, Colin

          L Offline
          L Offline
          led mike
          wrote on last edited by
          #4

          LCI wrote:

          This code works fine on my form application. Is there something i am missing.

          You mean like the exception information? :rolleyes:

          led mike

          L 1 Reply Last reply
          0
          • L led mike

            LCI wrote:

            This code works fine on my form application. Is there something i am missing.

            You mean like the exception information? :rolleyes:

            led mike

            L Offline
            L Offline
            LCI
            wrote on last edited by
            #5

            Thanks for the reply. The exception information is even more baffling. It basically says that access is denied to C:\WINDOWS\System32\This.xml The path that i am telling the code to generate the XML is C:\Test\This.xml Any thoughts are appreciated. Thanks,

            L 1 Reply Last reply
            0
            • L LCI

              Thanks for the reply. The exception information is even more baffling. It basically says that access is denied to C:\WINDOWS\System32\This.xml The path that i am telling the code to generate the XML is C:\Test\This.xml Any thoughts are appreciated. Thanks,

              L Offline
              L Offline
              led mike
              wrote on last edited by
              #6

              Based on your post my only thought is that there is something you don't know and therefore aren't telling me because what you posted is just not going to happen in a normal environment.

              led mike

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups