易截截图软件、单文件、免安装、纯绿色、仅160KB

读取 XML类 (XmlHelper)

using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;
namespace System.Bwch.XmlConfig
{
/**////
/// 读取XML配置文件类
///
public class XmlHelper
{
private string strXmlPath = ""; //Xml文档路径
private XmlDocument xmlDoc; //XML文档
/**////
/// 初始化ReadXml类
///
/// XML文件路径
public XmlHelper(string XMLPath)
{
if (!System.IO.File.Exists(XMLPath))
{
throw new Exception("没有找到指定的路径:" + XMLPath + "的XML文档");
}
strXmlPath = XMLPath;
xmlDoc = new XmlDocument();
xmlDoc.Load(XMLPath);
}
/**////
/// 读取XML文件指定键值的value 值
///
/// 键值的路径,格式为(根节点/节点/子节点)
/// 指定键值的属性名称
/// value值
public string ReadXmlValue(string XMLNodePath,string valueName)
{
try
{
XmlElement xml = (XmlElement)xmlDoc.SelectSingleNode(XMLNodePath);
return xml.GetAttribute(valueName);
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
}
/**////
/// 写XML指定节点的属性
///
/// 键值路径,格式为((根节点/节点/子节点))
/// 属性名称
/// 属性
///
public bool WriteXmlValue(string XmlNodePath,string valueName, string Value)
{
try
{
XmlElement xml = (XmlElement)xmlDoc.SelectSingleNode(XmlNodePath);
xml.SetAttribute(valueName, Value); //设置
xmlDoc.Save(strXmlPath); //保存
return true;
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
}
/**//


相关文档:

IsolatedStorageFile 本地数据缓存 xml dataset 读写

IsolatedStorageFile:包含文件和数据的独立存储区
dataset数据存储到本地xml文档,代码处理如下
public static void WriteDataToXML(DataSet dataset, string dataname)
{
try
{
IsolatedStorageFile isoStore = IsolatedStorageFile.GetUserStoreForAssembly(); / ......

php数据库导出类 导出JSON,XML,WORD,EXCEL

from:http://www.xland.com.cn/article/7/81/0804/28778.htm
本类实现:
数据库信息导出:word,excel,json,xml,sql
数据库恢复:从sql,从文件
具体用法:
首先新建测试用数据库mytest,然后在里面建张表
PHP代码:
以下是代码片段:
--
-- 表的结构 `test`
--
CREATE TABLE `test` (
   `id ......

AJAX (异步 JavaScript 和 XML)

AJAX (异步 JavaScript 和 XML) 是个新产生的术语,专为描述JavaScript的两项强大性能.这两项性
能在多年来一直被网络开发者所忽略,直到最近Gmail, Google suggest和google Maps的横空出世才使人
们开始意识到其重要性.
这两项被忽视的性能是:
* 无需重新装载整个页面便能向服务器发送请求.
* 对XML文档的解析和处理. ......

java SAX解析XML文件

import java.io.File;
import java.io.FileNotFoundException;
import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.Element;
import org.dom4j.io.SAXReader;
public class ResolveXmlFile {
 
 public void resolverXml() throws DocumentException, FileNotFoundExcept ......

怎么样在网页上读取远程xml的数据

 本文转自:http://www.10086web.com/html/wangluobiancheng/Xmlbiancheng/2009/0612/90.html
一个客户提供一个股价的信息,要求放在页面上,显示一些数据,需要从远程获取xml,然后解析写在网页上,开始不会觉得很难,其实蛮简单的,先用javascript写了一个:
<mce:script language=javascript><!--

......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号