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

²Ù×÷XML£¬¶ÔXMLµÄÔöɾ¸Ä²é²Ù×÷¡£asp.net C#

using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Xml;
namespace jiufen.Web.code
{
public class OperatingXML
{
XmlDocument xmlDoc = new XmlDocument();
//load xml file
private void LoadXml()
{
xmlDoc = new XmlDocument();
xmlDoc.Load(HttpContext.Current.Server.MapPath("xml/User.xml"));//xmlµÄ¸ùĿ¼
}
//Ìí¼Ó½Úµã
public void AddElement()
{
LoadXml();

XmlNode xmldocSelect = xmlDoc.SelectSingleNode("user");
XmlElement el = xmlDoc.CreateElement("person"); //Ìí¼Óperson½Úµã
el.SetAttribute("name", "ÖܽÜÂ×"); //Ìí¼Óperson½ÚµãµÄÊôÐÔ"name"
el.SetAttribute("sex", "ÄÐ"); //Ìí¼Óperson½ÚµãµÄÊôÐÔ "sex"
el.SetAttribute("age", "52"); //Ìí¼Óperson½ÚµãµÄÊôÐÔ "age"
XmlElement xesub1 = xmlDoc.CreateElement("pass"); //Ìí¼Óperson½ÚµãµÄÀïµÄ½Úµã
xesub1.InnerText = "22";//ÉèÖÃÎı¾½Úµã
el.AppendChild(xesub1);
XmlElement xesub2 = xmlDoc.CreateElement("Address");
xesub2.InnerText = "À¥Ã÷";//ÉèÖÃÎı¾½Úµã
el.AppendChild(xesub2);
xmldocSelect.AppendChild(el);
xmlDoc.Save(HttpContext.Current.Server.MapPath("xml/User.xml"));
}
//Ð޸Ľڵã
public void UpdateElement()
{
LoadXml();
XmlNodeList nodeList = xmlDoc.SelectSingleNode("user").ChildNodes;//»ñÈ¡bookstore½ÚµãµÄËùÓÐ×Ó½Úµã
foreach (XmlNode xn in nodeList)//±éÀúËùÓÐ×Ó½Úµã
{
XmlElement xe = (XmlElement)xn;//½«×Ó½ÚµãÀàÐÍת»»ÎªXmlElementÀàÐÍ
if (xe.GetAttribute("name") == "ÖܽÜÂ×")//Èç¹ûnameÊôÐÔÖ


Ïà¹ØÎĵµ£º

ASP.NET Ê×Ò³ÐÔÄܵÄÊ®´ó×ö·¨

ASP.NET Ê×Ò³ÐÔÄܵÄÊ®´ó×ö·¨
Ç°ÑÔ
±¾ÎÄÊÇÎÒ¶ÔASP.NETÒ³ÃæÔØÈëËÙ¶ÈÌá¸ßµÄһЩ×ö·¨£¬ÕâЩ×ö·¨·ÖΪÒÔϲ¿·Ö£º
1.²ÉÓà HTTP Module ¿ØÖÆÒ³ÃæµÄÉúÃüÖÜÆÚ¡£
2.×Ô¶¨ÒåResponse.FilterµÃµ½Êä³öÁ÷streamÉú³É¶¯Ì¬Ò³ÃæµÄ¾²Ì¬ÄÚÈÝ(´ÅÅÌ»º´æ)¡£
3.Ò³ÃæGZIPѹËõ¡£
4.OutputCache ±à³Ì·½Ê½Êä³öÒ³Ã滺´æ¡£
5.ɾ³ýÒ³Ãæ¿Õ°××Ö·û´® ......

¸ÅÊöASP.NET´íÎó´¦Àí


±¾ÎĽéÉÜASP.NET´íÎó´¦Àí£¬ÒÔ¼°½éÉÜÈç¹ûÄúµÄÓ¦ÓóÌÐòÊÔͼµÇ¼Êý¾Ý¿âʱûÓгɹ¦£¬ÔòÏÔʾµÄ´íÎóÐÅÏ¢²»Ó¦¸Ã°üÀ¨ËüÕýÔÚʹÓõÄÓû§Ãû¡£
Òª´´½¨Ò³ÖеÄÈ«¾Ö´¦Àí³ÌÐò£¬Çë´´½¨ Page_Error ʼþµÄ´¦Àí³ÌÐò¡£Òª´´½¨ASP.NETÓ¦ÓóÌÐò·¶Î§µÄ´íÎó´¦Àí³ÌÐò£¬ÇëÔÚ Global.asax ÎļþÖн«´úÂëÌí¼Óµ½ Application_Error ·½·¨¡£Ö»ÒªÄúµÄÒ³»òÓ¦ ......

JAVA¶ÔÏóת»»ÎªXML¸ñʽ

JAVA¶ÔÏóת»»ÎªXML¸ñʽ
    ¼òµ¥µÄ²üÊöÏÂÈçºÎ½«JAVA¶ÔÏóת»»ÎªXML¸ñʽ£¬ÏêϸÁ˽âÇë½øÈëhttp://xstream.codehaus.org/tutorial.html
  
 JAVABEAN¶ÔÏó
 
  userInfo.java
         private String name;
   & ......

DataSet¡¢Excel¡¢XMLÖ®¼äµÄµ¼Èëµ¼³ö

class ImportExportToExcel
{
public class ImportExportToExcel
{
private string strConn;
private System.Windows.Forms.OpenFileDialog openFileDlg = new System.Windows.Forms.OpenFileDialog();
private System.Windows.Forms.SaveFileDialog saveFi ......

Integration with the XML Data Type

Integration with the XML Data Type
With the introduction of the XML data type, we wanted to also give FOR XML the ability to generate an instance of XML directly (more precisely, it generates a single row, single column rowset where the cell contains the XML data type instance).
Because of the bac ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ