Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problems writing XML
Message
From
10/11/2004 06:11:57
Bill Benton
North Florida Software Services
Middleburg, Florida, United States
 
 
General information
Forum:
ASP.NET
Category:
XML
Miscellaneous
Thread ID:
00958201
Message ID:
00959907
Views:
9
Hi again Viv,

I am now receiving the following error:
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: 116 
This 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!!!!!


>Hi,
>
>... but I am having difficulty saving the XML to a specific file. I would like to save each file to it's corresponding "application number.XML".
>
>Don't know where you get your 'application number from' but, as an example, does this help:
>
>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()
>
>
>Regards,
>Viv
Bill Benton
Senior Systems Analyst
Nuvell Financial Services
Previous
Reply
Map
View

Click here to load this message in the networking platform