XML 增、删、改、求平均数
string file = "c:\\work.xml";
private void btnCearte_Click(object sender, EventArgs e)
{
XmlDocument doc = new XmlDocument();
XmlDeclaration dl = doc.CreateXmlDeclaration("1.0", "Unicode", null);
doc.AppendChild(dl);
XmlElement @class = doc.CreateElement("class");
doc.AppendChild(@class);
doc.Save(file);
}
private void btnInsert_Click(object sender, EventArgs e)
{
XmlDocument doc = new XmlDocument();
doc.Load(file);
XmlElement student = doc.CreateElement("student");
student.SetAttribute("age", "20");
XmlElement name = doc.CreateElement("name");
name.InnerText = "童小霞";
XmlElement sex = doc.CreateElement("sex");
sex.InnerText = "famale";
student.AppendChild(name);
student.AppendChil
相关文档:
用c#给PDA做了一个PC端的通讯程序,需要保存两个参数。用Delphi时,是保存在ini文件中,c#读写XML比较方便,就用xml文件来保存了。
class CXmlClass
{
private string XmlFilePath;
/// <summary>
/// 下载到PDA的TXT文件路径
/// </summary>
......
http://stackoverflow.com/questions/1112828/cannot-decode-string-with-wide-characters-appears-on-a-weird-place
http://man.ddvip.com/web/xmlzhzn/xml_cn/xml_encoding.asp.htm
http://bbs.xml.org.cn/dispbbs.asp?boardID=8&ID=7226
http://topic.csdn.net/t/20030909/13/2240153.html
#
http://www.ezloo. ......
本文系转载,谨向转载处空间拥有者及源出处文章作者表示感谢!
转载处:http://henry19890701.javaeye.com/blog/481462
源出处:http://www.ziliaonet.com/tech/netprogramme/XML/200605/69398.html
在做一般的XML数据交换过程中,我更乐意传递XML字符串,而不是格式化的XML Document。这就涉及到XML字符串和Xml Docume ......
1.route.xml文件内容
<?xml version="1.0" encoding="GBK"?>
<root>
<route id="1111">
<id>111</id>
<name>四川</name>
<path>www.baidu.com/hehe.html</path>
</route>
</root>
2.test.html代码
<html>
<body>
<script> ......
[System.Runtime.Serialization.DataMemberAttribute()]
public Information Archive {
get {
&n ......