使用XmlDocument类完成对XML的查、删、添、改
使用XmlDocument类完成对XML的查、删、添、改
http://www.aspdiy.net/article/53.htm
后台C#代码
1using System;
2using System.Collections;
3using System.ComponentModel;
4using System.Data;
5using System.Drawing;
6using System.Web;
7using System.Web.SessionState;
8using System.Web.UI;
9using System.Web.UI.WebControls;
10using System.Web.UI.HtmlControls;
11//新引入两个命名空间
12using System.Xml;
13using System.Xml.XPath;
14
15namespace XML
16{
17 /**//// <summary>
18 /// xdoc 的摘要说明。
19 /// </summary>
20 public class xdoc : System.Web.UI.Page
21 {
22 protected System.Web.UI.WebControls.Label Label1;
23 protected System.Web.UI.WebControls.Label Label2;
24 protected System.Web.UI.WebControls.Button Button1;
25 protected System.Web.UI.WebControls.Label Label3;
26 protected System.Web.UI.WebControls.Button Button2;
27 protected System.Web.UI.WebControls.Button Button3;
28 protected System.Web.UI.WebControls.DataGrid dg;
29 protected System.Web.UI.WebControls.DropDownList ddl;
30 protected System.Web.UI.WebControls.TextBox tbn;
31 protected System.Web.UI.WebControls.Label Label4;
32 protected System.Web.UI.WebControls.Label Label5;
33 protected System.Web
相关文档:
一、本章主要介绍.NET XML序列化,构建XML序列化的框架类,主要放在你的框架项目里面,类名字命名为Serialiser,我的框架项目名称是MingXu.FrameWork,我将Serialiser放到它下面,MingXu.FrameWork类型为Class Library
二、序列化类用到了2个dll,分别为:
System.Xml.Serialization:X ......
Class.xml
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/css" href="class.css"?>
<bookdetail>
<book class="A">
<author>曹雪芹</author>
<title>红楼梦</title>
<price>60.00</price>
</book>
<book class="A"& ......
ID.xml
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/css" href="ID.css"?>
<bookdetail>
<book class="A" id="B1">
<author>曹雪芹</author>
<title>红楼梦</title>
<price>60.00</price>
</book>
<book class="A ......
最近项目中要用到一些web xml数据的访问分析,采用msxml
1.msxml是微软提供的,在非开发环境中,需要注册
2.xml文件,一般在第一句有编码方式,一般默认是utf-8,属于一种unicode
3.从网络采集的xml数据,需要使用winnet函数库
4.winnet采集自网络的数据,默认的都是CP_ACP格式的,简单说就是ANSI或UNICODE,UTF8的编码 ......
xmlpost by HttpWebRequest:
protected string PostXmlToURL(string url,string data)
{
HttpWebRequest hwr = (HttpWebRequest)HttpWebRequest.Create(url);
hwr.Method = "POST";
Stream stream = hwr.GetRequestStream();
StreamWri ......