CurrNode = xmldoc.DocumentElement;
//插入新闻索引队列中
CurrNode.InsertAfter(docFrag, CurrNode.LastChild);
//保存索引文件
xmldoc.Save(Server.MapPath("contents.xml"));
//把TextBox5中的文件换成符合xml格式的内容
string xmlfile;
xmlfile = TextBox5.Text;
xmlfile = xmlfile.Replace("<", " lt; ");
xmlfile = xmlfile.Replace(">", " gt; ");
xmlfile = xmlfile.Replace("//", " apos;");
xmlfile = xmlfile.Replace("\r\n", "</paragraph><paragraph>");
//把数据写入新建的xml文件中去;
XmlDocument doc;
doc = new XmlDocument();
insstr = "<?xml version='1.0' encoding='GB2312'?><document><title>";
insstr = TextBox2.Text "</title><abstract>" TextBox4.Text;
insstr = "</abstract><author>" TextBox3.Text "</author><content><paragraph>";
insstr = xmlfile "</paragraph></content></document>";
doc.LoadXml(insstr);
doc.Save(Server.MapPath(TextBox1.Text ".xml"));
Response.Write("新闻发布成功!");
TextBox1.Text = "";
TextBox2.Text = "";
TextBox3.Text = "";
TextBox4.Text = "";
TextBox5.Text = "";
}
}
}
现在,一个简单的新闻发布系统已经建立完毕,你还可以编写更新程序,可以参照发布程序来写,有什么好的办法希望我们共享哦!
http://www.cnblogs.com/support/archive/2006/10/13/528544.html
文章整理:西部数码--专业提供域名注册、虚拟主机服务
http://www.west263.com
以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!



