没有合适的资源?快使用搜索试试~ 我知道了~
C# 操作XML.txt 还不错 多个关键字请用空格分隔,最多填写5个。点击右侧Tag快速添加
资源推荐
资源详情
资源评论
2006-10-4 21:05 hphubei
写 XML 文件的
*------------------------------------------------------------------------------------------------------*
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Xml;
namespace WindowsApplication2
{
public partial class Form1 : Form
{
private XmlDocument XmlDoc = new XmlDocument();
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
XmlDoc.Load(@filename);
写 XML 文件的
*------------------------------------------------------------------------------------------------------*
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Xml;
namespace WindowsApplication2
{
public partial class Form1 : Form
{
private XmlDocument XmlDoc = new XmlDocument();
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
XmlDoc.Load(@filename);
XmlNode RootNode = XmlDoc.DocumentElement;
GetNodes(RootNode);
}
private void GetNodesValue()
{
}
private int i = 1;
private string filename = System.Windows.Forms.Application.StartupPath + "\\test.xml";
private void GetNodes(XmlNode node)
{
if (node.Name == "entry")
{
XmlAttribute Myvalue = node.Attributes["value"];
MessageBox.Show(Myvalue.Value.ToString() );
XmlElement el;
el=node as XmlElement ;
if (i == 4)
{
node.Attributes["value"].Value = "654321";
MessageBox.Show(el.Attributes["value"].Value);
XmlDoc.Save(filename);
GetNodes(RootNode);
}
private void GetNodesValue()
{
}
private int i = 1;
private string filename = System.Windows.Forms.Application.StartupPath + "\\test.xml";
private void GetNodes(XmlNode node)
{
if (node.Name == "entry")
{
XmlAttribute Myvalue = node.Attributes["value"];
MessageBox.Show(Myvalue.Value.ToString() );
XmlElement el;
el=node as XmlElement ;
if (i == 4)
{
node.Attributes["value"].Value = "654321";
MessageBox.Show(el.Attributes["value"].Value);
XmlDoc.Save(filename);
剩余22页未读,继续阅读
资源评论
llwlz
- 粉丝: 4
- 资源: 23
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功