C#写XML的简单例子
这个例子要把bookstore.xml文件增加一条book记录
1 bookstore.xml
<?xml version="1.0" encoding="gb2312"?>
<bookstore>
<book genre="love" ISBN="1234123">
<title>who am i </title>
<author>who</author>
<price>999</price>
</book>
</bookstore>
2 bookstore.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
namespace toxml
{
public class ToXml
{
public static void Main(string[] args)
{
//实例化一个XmlDocument对象
XmlDocument xmlDoc = new XmlDocument();
//实例对象读取要写入的XML文件
xmlDoc.Load("bookstore.xml");
//查找<bookstore>
XmlNode root = xmlDoc.SelectSingleNode("bookstore");
//创建一个<book>节点
XmlElement xe1 = xmlDoc.CreateElement("book");
//设置该节点genre属性
xe1.SetAttribute("leixing", "music");
//设置该节点ISBN属性
xe1.SetAttribute("ISBN", "56756");
 
相关文档:
TCP是连接模型,如下:
服务器连接 服务器断开
↓   ......
最近客户索要产品的二次开发类库文档,由于开发过程中并没有考虑过此类文档,而且项目规范比较,持续时间比较长,经手人比较多,还真是麻烦,如果人工制作文档需要是一个比较大的工程.还好有这个文档生成工具,能够根据项目生成文档,而且格式看起来确实很专业.
Sa ......
using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Syste ......
Ajax和jsp的怪现象
如果用Ajax去请求一个jsp页面,该jsp页面返回的是xml(response.setContentType("text/xml; charset=GB2312");),并且该jsp包含下面这些头@page指令的话,则在客户端xml=XMLHttpRequest.responseXML得到的是一个不包含任务东西的xml对象,即xml.childNodes.length将会是0.
......
HTML - Hyper Text Mark-up Language - 超文本标记语言
HTML-超文本标记语言,是WWW的描述语言。设计HTML语言的目的是为了能把存放在一台电脑中的文本或图形与另一台电脑中的文本或图形方便地联系在一起,形成有机的整体,人们不用考虑具体信息是在当前电脑上还是在网络的其它电脑上。我们只 ......