Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ʵÀýÆÊÎöxmlÓ¦Óã¨1£©

using System;
using System.Data;
using System.Configuration;
using System.Collections;
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;
 //µ¼ÈëʹÓÃxmlÓ¦ÓÃËùÐèµÄÃüÃû¿Õ¼ä
using System.Xml.XPath;
using System.Xml;
using System.IO;
using System.Xml.Xsl;
public partial class login0 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
    }
    protected void btnok_Click(object sender, EventArgs e)
    {
        DataSet ds = new DataSet();//н¨Êý¾Ý¼¯¶ÔÏó
        ds.ReadXml(Server.MapPath("ad/user.xml"));//ʹÓøöÔÏóµÄReadXml()·½·¨·ÃÎÊxmlÎļþ
     
        DataTable dt = ds.Tables[0];//н¨Êý¾Ý±í¶ÔÏ󣬽«Êý¾Ý¼¯¶ÔÏóÖеĵÚÒ»¸ö±í¸³¸øÕâ¸ö¶ÔÏó
        DataRow[] dta = dt.Select("userName='" + userName.Text.Trim() + "'");//ÓÃÊý¾Ý±í¶ÔÏóµÄSelect()·½·¨²éѯËù¸øÌõ¼þÊÇ·ñ´æÔÚ
     
        if (dta != null && dta.Length > 0)//Èô´æÔÚ£¬Âú×ã¸ÃÌõ¼þµÄÐн«¸³¸ødtaÊý¾ÝÐм¯¶ÔÏó
        {
            DataRow dr = dta[0];//°Ñ¼¯ÖеÚÒ»Ðи³¸øÊý¾ÝÐжÔÏó
            string strPwd = (string)dr["userPwd"];//ÕÒ³ö¸ÃÐÐÖÐÃÜÂëÁУ¬¸³¸ø±äÁ¿strPwd
            if (strPwd == this.userPwd.Text.Trim())//Èç¹ûÓëÎı¾¿òÄÚÈÝÆ¥Åä
            {
 &nbs


Ïà¹ØÎĵµ£º

³¬¼¶´ó±¿ÀÇÖйúÏóÆå(js+xml)

<html xmlns:v="urn:schemas-microsoft-com:vml">
<head>
 <STYLE>
  v\:* { Behavior: url(#default#VML) }
  body {
   background-color:DarkGoldenrod;
   margin-left: 10px;
 &nbs ......

DataTabת»»XML XMLת»»DataTable µÄÀà

public string ConvertDataTableToXML(DataTable xmlDS)
{
MemoryStream stream = null;
XmlTextWriter writer = null;
try
{
stream = new MemoryStream();
writer = new XmlTextWriter(stream, Encoding.Default);
......

xml£¬jsp,dtd,xsd ÌáʾÐÅÏ¢

½øÈëMyEclipse6.XÏÂ
Ð޸ģºeclipse.ini Îļþ
-Duser.language=en
¸Ä³É
-Duser.language=zh
µ¯³öÌáʾ£ºCtrl+"/"
dtd ÃüÃû¿Õ¼äµÄÌáʾÐÅÏ¢
window-->Preference-->xml-->XML Catalog-->add
Location :sql-map-2.dtd
key type :pubic ID
key:-//ibatis.apache.org//DTD SQL Map 2.0//EN (XMLÎļþÃüÃû¿Õ¼ ......

¶ÁÈ¡xmlʱ EntityName ʱ³ö´í

public static Hashtable xml_unserialize(string strXml)
        {
//¼ÓÉÏÏÂÃæÕâ¾ä¾ÍºÃÁË
strXml = strXml.Replace("&", "&amp;");
Hashtable ht = new Hashtable();
XmlDocument XMLDom = new XmlDocument();
......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ