Access to the path "C:\WINNT\system32\3640529.XML" is denied. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.UnauthorizedAccessException: Access to the path "C:\WINNT\system32\3640529.XML" is denied. ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true"/>, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user. To grant ASP.NET write access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access. Source Error: Line 114: this.cMyXMLPath =Server.MapPath(myXML); Line 115: this.mFileName = (this.dsAfglog.Tables["afglog"].Rows[0]["app_num"].ToString().Trim() + ".XML"); Line 116: XmlTextWriter XMLHistory = new XmlTextWriter(this.mFileName, null); Line 117: XMLHistory.Formatting = Formatting.Indented; Line 118: XMLHistory.WriteStartDocument(false); Source File: c:\inetpub\wwwroot\prox_xml\webform1.aspx.cs Line: 116This is basically the same problem I have been having all along. I can write all day to "File1.XML", which is the document that was originally used for output (and also File1.XSD that was utilized as the schema). How can a file that has not been created be given rights? Why is it attempting to write (or open) a file in that directory? This is getting extremely frustrating!!!!!
>Dim AppNum as integer = 12345 'sample number > >Dim w As New Xml.XmlTextWriter(AppNum.ToString.Trim + ".XML", Nothing) >w.WriteStartDocument() >w.WriteStartElement("salary") >w.WriteAttributeString("type", "annual") >w.WriteString("4500") >w.WriteEndElement() >w.WriteEndDocument() >w.Flush() >w.Close() >>