社区
C#
帖子详情
问个关于System.xml的问题?(pie9912)
pie9912
2001-10-23 10:59:54
我想通过C#来实现往我的xml文件中加入数据!
我的infor.xml
<person>
<name>pie</name>
<E_mail>pie@263.com</E_mail>
<address>xmu</address>
</person>
怎么加入一个节点为<person>
请高手帮忙!
谢谢!
...全文
70
1
打赏
收藏
问个关于System.xml的问题?(pie9912)
我想通过C#来实现往我的xml文件中加入数据! 我的infor.xml pie pie@263.com xmu 怎么加入一个节点为 请高手帮忙! 谢谢!
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
1 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
zhang_samuel
2001-10-24
打赏
举报
回复
if following is your infor.xml ( suppose it located in root directory of disk C)
<?xml version="1.0" encoding="utf-8"?>
<Root>
<person>
<name>pie</name>
<E_mail>pie@263.com</E_mail>
<address>xmu</address>
</person>
</Root>
XmlDocument doc;
doc=new XmlDocument();
doc.Load(@"c:\Infor.XML");
XmlElement rootElement=doc.DocumentElement;
XmlElement newChild;
XmlElement newChild2;
XmlElement newChild3;
XmlElement newChild4;
newChild= doc.CreateElement("person");
// <person>
//<name>pie</name>
//<E_mail>pie@263.com</E_mail>
//<address>xmu</address>
//</person>
newChild2=doc.CreateElement("name");
newChild2.InnerText="pie";
newChild3=doc.CreateElement("E_mail");
newChild3.InnerText="pie@263.com";
newChild4=doc.CreateElement("address");
newChild4.InnerText="xmu";
newChild.AppendChild(newChild2);
newChild.AppendChild(newChild3);
newChild.AppendChild(newChild4);
rootElement.AppendChild(newChild);
doc.Save(@"c:\Infor.XML");
MYASP-fusionChart报表源代码(包能运行)
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using InfoSoftGlobal; using System.Text; using System.Data.SqlClient; using System.Data; namespace MYASP { ///
/// Author:jilongliang ///
public partial class index : System.Web.UI.Page { protected void Page_Load (object sender, EventArgs e) { } ///
/// 直接在控件加载出来 ///
/// /// protected void Literal1_Load (object sender, EventArgs e) { Literal1.Text = FusionCharts.RenderChart("swf/ScrollCombiDY2D.swf", "fusioncharts.
xml
", "", "fusioncharts1", "500", "500", false, true); } ///
/// 用户输入显示的图形fusioncharts ///
/// /// protected void btnSubmit_Click (object sender, EventArgs e) { //Request.Form() //Label1.Text = Request["ponit1"]; StringBuilder
xml
Data = new StringBuilder();
xml
Data.Append("");
xml
Data.AppendFormat("", txtPoint1.Text); //txtPoint1.Text
xml
Data.AppendFormat("", txtPoint2.Text);
xml
Data.AppendFormat("", txtPoint3.Text);
xml
Data.AppendFormat("", txtPoint4.Text);
xml
Data.Append(""); Literal1.Text = FusionCharts.RenderChart("swf/Pie3D.swf", "",
xml
Data.ToString(), "fusioncharts2", "800", "500", false, false); } ///
/// 从数据库读数据 ///
/// /// protected void Literal2_Load (object sender, EventArgs e) { string query = "select Team ,Points from tb_charts"; StringBuilder
xml
Data = new StringBuilder(); using(SqlDataReader dr = SQLDBHelper.ExecuteReader(CommandType.Text, query, null)) { //
xml
Data.AppendFormat(""); while(dr.Read()) {
xml
Data.AppendFormat("", dr ["Team"].ToString(), dr ["Points"].ToString()); }
xml
Data.AppendFormat(""); Literal2.Text = FusionCharts.RenderChart("swf/Column3D.swf", "",
xml
Data.ToString(), "testChart", "500", "500", false, true); } } ///
/// ///
/// /// protected void test2_Click (object sender, EventArgs e) { string str1=Request ["ponit1"]; Label1.Text=str1; StringBuilder
xml
Data = new StringBuilder();
xml
Data.Append("");
xml
Data.AppendFormat("", txtPoint1.Text); //txtPoint1.Text
xml
Data.AppendFormat("", txtPoint2.Text);
xml
Data.AppendFormat("", txtPoint3.Text);
xml
Data.AppendFormat("", txtPoint4.Text);
xml
Data.Append(""); Literal1.Text = FusionCharts.RenderChart("swf/Pie3D.swf", "",
xml
Data.ToString(), "fusioncharts2", "800", "500", false, false); } protected void test2_Click1 (object sender, EventArgs e) { } } }
Android-system-principle-.zip_android_android principle
Android系统原理与开发要点详解
dom4japi,帮助文档,实例,方法,ppt
dom4japi,帮助文档,实例,方法,ppt,课件什么的都有
C# WinForm ChartClickEvent
对C#Winform chart上的数据进行操作,根据要求显示不同类型的图表,并获取图表上的实际坐标值
android自定义时间控件实现系统时间修改
自定义时间控,对android系统的时间日期进行修改,使用时请认识阅读里面的readMe.txt。里面有详细介绍。因为这里需要系统的权限。
C#
111,115
社区成员
642,552
社区内容
发帖
与我相关
我的任务
C#
.NET技术 C#
复制链接
扫一扫
分享
社区描述
.NET技术 C#
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
让您成为最强悍的C#开发者
试试用AI创作助手写篇文章吧
+ 用AI写文章