[求助]关于XML写入的问题
当执行下面代码的时候就出错了,请高手指教
XmlNode node;
XmlDocument xmldoc = new XmlDocument();
xmldoc.Load(Server.MapPath("~/XmlNews/news.xml"));
string insstr;
insstr = "<topic><title>" + txtTitle.Text + "</title><href>shownews.aspx?title=" + txtTitle.Text + "</href></topic>";
XmlDocumentFragment docfrag = xmldoc.CreateDocumentFragment();
docfrag.InnerXml = insstr;
node = xmldoc.DocumentElement;
node.InsertAfter(docfrag, node.LastChild);
xmldoc.Save(Server.MapPath("~/XmlNews/news.xml"));
错误原因:对路径“C:\Inetpub\wwwroot\news\XmlNews\news.xml”的访问被拒绝。