using System; using System.Data; using System.IO; using System.Text; using System.Threading; using System.Xml; using System.Xml.Serialization; using Shared; namespace Helpers { public static class XmlHelper { #region Fields and Properties public enum…
XML序列化   #region 序列化 /// <summary> /// XML序列化 /// </summary> /// <param name="obj">序列对象</param> /// <param name="filePath">XML文件路径</param> /// <returns>是否成功</returns> public static bool S…
using System; using System.Collections.Generic; using System.IO; using System.Text; using System.Xml; namespace CommonUtil { /// <summary> /// Xml通用操作类 /// </summary> public class XmlHelper { public XmlHelper() { } /// <summary> /// 创建XM…
前言 导入excel数据, 在每个项目中基本上都会遇到,第三方插件或者基于微软office,用的最多的就是npoi,aspose.cells和c#基于office这三种方式,其中各有各的优缺点,在这也不再累述.导入npoi封装的方法特别好,但是导出好像没有那一个是进行封装操作的,这两天正好有这块需求,所有就写了一个操作类xx,请不要看到xml就说这不是还要写东西吗,此封装是为了减少代码的书写.功能扩展基本上来源于XML. 需求分析 1.首先我们要做的就是要把excel中的数据导入到数据库,基于项…
<?php /** * redis操作类 * 说明,任何为false的串,存在redis中都是空串. * 只有在key不存在时,才会返回false. * 这点可用于防止缓存穿透 * */ class Redis { private $redis; //当前数据库ID号 protected $dbId=0; //当前权限认证码 protected $auth; /** * 实例化的对象,单例模式. * @var \iphp\db\Redis */ static private $_instance…
<?php /** * redis操作类 * 说明,任何为false的串,存在redis中都是空串. * 只有在key不存在时,才会返回false. * 这点可用于防止缓存穿透 * */ class Redis { private $redis; //当前数据库ID号 protected $dbId=0; //当前权限认证码 protected $auth; /** * 实例化的对象,单例模式. * @var \iphp\db\Redis */ static private $_instance…
类的完整代码: using System;using System.Collections;using System.Xml; namespace Keleyi.Com.XmlDAL{public class XmlHelper{#region 公共变量XmlDocument xmldoc;XmlNode xmlnode;XmlElement xmlelem;#endregion #region 创建Xml文档/// <summary>/// 创建一个带有根节点的Xml文件/// </s…
这个类是在微软XML操作类库上进行的封装,只是为了更加简单使用,包括XML类创建节点的示例. using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; using System.Xml; namespace testForm { class Operation_APPCFG { XmlDocument xmldoc; XmlNode…
在之前,我写了一个websql的封装类库,代码如下: (function(win) { function smpWebSql(options){ options = options || {}; this.database = null; this.DateBaseName = options.DateBaseName || 'SmpDB'; this.Version = options.Version || '1.0'; this.Description = options.Descripti…
<?phpclass XML{    private $dom;        function __construct ()    {        $this->dom = new DOMDocument ('1.0','UTF-8');        header ("Content-Type:text/xml");    } //传递普通节点名称,创建节点    function CreateNode ($node)    {        return $this…