101 VB.NET Samples --XML文件的处理

在.Net Frame里的如何处理XML文件的呢.

这要用到System.Xml名字空间.具体的说明要见MSDN.

用到的类有XmlDocumnet,XmlElement,XmlComment,XmlText ,XmlAttribute类

下面是MS例子里的说明:

.NET Framework: Using the XMLDocument Class

This sample shows how to take advantage of the XMLDocument class built-in to System.Xml.dll. This class exposes the XML Document Object Model, or DOM, which can be used to manipulate XML data. 

Featured Highlights

In previous versions of Visual Basic, XML processing support for the DOM was provided by the MSXML COM library. The .NET Framework provides a vast array of functionality that equals and oftentimes exceeds those functions found in earlier versions of MSXML. This sample takes a task-based approach to showing how to use the DOM. A checked listbox control lists a set of 'How do I' options. Selecting one will perform the task. You might wish to add breakpoints to examine the code and comments as it runs.

Requirements

Requires the Trial or Release version of Visual Studio .NET Professional (or greater).

Running the Sample

When the sample loads, it checks for the existence of three files:

  • Simple.xml
  • New.xml
  • Bad.xml

If any one of the three does not exist, the main UI will be disabled. The files are located in the /bin folder of the project folder. If the files exist, you will be able to chose a set of commands loaded in to a checked listbox control. Simply highlight an item on the list and then change its check box to selected and the command will be executed. Note some of the commands require saving changes out to disk. Make sure you have read/write permissions to the /bin directory.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值