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

Asp.Net XML操作基类(修改,删除,新增,创建)

Asp.Net XML操作基类(修改,删除,新增,创建)
2009-12-21 16:59
/**********************************************************************************
*
* 功能说明:XML处理基类
* 作者: 刘功勋;
* 版本:V0.1(C#2.0);时间:2006-12-13
*
* *******************************************************************************/
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.IO;
using System.Xml;
using System.Text;
using MSXML2;
namespace EC
{
/// <summary>
/// XML 操作基类
/// </summary>
public class XmlObject : IDisposable
{     
       
//以下为单一功能的静态类
#region 读取XML到DataSet
/**************************************************
* 函数名称:GetXml(string XmlPath)
* 功能说明:读取XML到DataSet
* 参    数:XmlPath:xml文档路径
* 使用示列:
*          using EC; //引用命名空间
*          string xmlPath = Server.MapPath("/EBDnsConfig/DnsConfig.xml"); //获取xml路径
*          DataSet ds = EC.XmlObject.GetXml(xmlPath); //读取xml到DataSet中
************************************************/
/// <summary>
/// 功能:读取XML到DataSet中
/// </summary>
/// <param name="XmlPath">xml路径</param>
/// <returns>DataSet</returns>
public static DataSet GetXml(string XmlPath)
{
DataSet ds = new DataSet();
ds.ReadXml(@XmlPath);
return ds;
}
#endregion
        #region 读取xml文档并返回一个节点
/**************************************************
* 函数名称:ReadXmlReturnNode(string XmlPath,string Node)
* 功能说明:读取xml文档并返回一个节点:适用于一级节点
* 参  &


相关文档:

asp.net中使用基于角色role的Forms验证

asp.net中使用基于角色role的Forms验证,大致经过几下四步:
1.配置系统web.config
timeout="20" path="/" />
其中 表示本应用程序采用Forms验证方式。
1). 标签中的name表示指定要用于身份验证的 HTTP Cookie。默认情况下,name 的值是 .ASPXAUTH。采用此种方式验证用户后,以此用户的信息建立一个FormsAuthenticati ......

DataSet(DataTable)与XML互转

using System;
using System.Data;
using System.IO;
using System.Xml;
using System.Text;
// 相应C#代码:
private string ConvertDataTableToXML(DataTable xmlDS)
{
MemoryStream stream = null;
XmlTextWriter writer = null;
try
{
stream = new MemoryStream();
writer = new XmlTextWriter(stream, E ......

ASP.NET Routing for URLRewriting with QueryStrings

In the last post I showed how to use the ASP.NET 3.5 Routing Engine
for URLRewriting purposes. I want to go further in this post by adding
the ability to add variables into a route path and forward and append
query string variables to the destination Web Form request.
A route can contain one or ......

asp.net生成静态页

先建个html模版页(template.htm):
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>$title</title>
</head>
&l ......

Asp.Net设置绑定GridView中的控件

 1、界面代码:         
  <asp:GridView ID="gridTemplateDetailList" runat="server"
                   AutoGenerateColumns="False"
  &nbs ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号