将数据写入xml文档的问题~!!! - .NET技术 / C#
我用以下代码将一组FORM的数据存储到XML文档可以实现,但是当我再次调用该函数的时候,就会覆盖前面保存的数据,如果我想在以保存的数据下面继续保存写入的数据改怎么写,麻烦个位帮个忙指点下,呵呵~!!!
public void XmlDocument()
{
string ServerIp = this.ServerIpBox.Text;
string ServerName = this.ServerNameBox.Text;
string ServerPort = this.ServerPortBox.Text;
string UserName = this.UserNameBox.Text;
string UserPwd = this.UserPwdBox.Text;
XmlDocument doc = new XmlDocument();
XmlElement friendsinfo = doc.CreateElement("ViewManage");
XmlDeclaration sm = doc.CreateXmlDeclaration("1.0", "GB2312", "no");
doc.AppendChild(sm);
doc.AppendChild(friendsinfo);
XmlElement hy = doc.CreateElement("ViewPara");
hy.SetAttribute("nodeText", ServerName);
XmlElement ip = doc.CreateElement("IP");
ip.AppendChild(doc.CreateTextNode(ServerIp));
hy.AppendChild(ip);
XmlElement port = doc.CreateElement("Port");
port.AppendChild(doc.CreateTextNode(S
相关问答:
现在有个xml文件是<?xml version="1.0"?>
<?mso-application progid="Excel.Sheet"?>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
xm ......
思路:要用c#生成一个播放机的播放列表的xml,例如:
<daty datys='2010-04-05' datye='2010-05-01' > //这是播放的日期段
<time times='01:12:00' timee='02:30:00'> ......
XML文件内容:
- <ResList>
<page>0</page>
- <resItem>
<resName>WWW</resName>
</resItem>
- <resItem>
&nb ......
使用ACCESS最大的隐患就是不安全。今天对ACCESS数据库设置了一个密码,必须使用密码才能打开,但是在程序中却无法连接数据库了。大家知道使用用户名和密码,如何连接ACCESS数据库?貌似ACCESS的用户名还不知道?只知 ......
大家好,我是新手,刚开始接触C/S结构的程序,想要实现一个分页功能,大家有没有好点的分页控件或者程序之类的,当然源程序更好,否则说说流程也可以,小妹急啊,在线等。。。。
大家帮帮忙,谢了!
自己写呀!
......