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

asp.net²Ù×÷XMLС½á

 

Ò»¡¢¼òµ¥½éÉÜ
using System.Xml;
//³õʼ»¯Ò»¸öxmlʵÀý
XmlDocument xml=new XmlDocument();
//µ¼ÈëÖ¸¶¨xmlÎļþ
xml.Load(path);
xml.Load(HttpContext.Current.Server.MapPath("~/file/bookstore.xml"));
//Ö¸¶¨Ò»¸ö½Úµã
XmlNode root=xml.SelectSingleNode("/root");
//»ñÈ¡½ÚµãÏÂËùÓÐÖ±½Ó×Ó½Úµã
XmlNodeList childlist=root.ChildNodes;
//ÅжϸýڵãÏÂÊÇ·ñÓÐ×Ó½Úµã
root.HasChildNodes;
//»ñȡͬÃûͬ¼¶½Úµã¼¯ºÏ
XmlNodeList nodelist=xml.SelectNodes("/Root/News");
//Éú³ÉÒ»¸öнڵã
XmlElement node=xml.CreateElement("News");
//½«½Úµã¼Óµ½Ö¸¶¨½ÚµãÏ£¬×÷ΪÆä×Ó½Úµã
root.AppendChild(node);
//½«½Úµã¼Óµ½Ö¸¶¨½ÚµãÏÂij¸ö×Ó½ÚµãÇ°
root.InsertBefore(node,root.ChildeNodes[i]);
//Ϊָ¶¨½ÚµãµÄн¨ÊôÐÔ²¢¸³Öµ
node.SetAttribute("id","11111");
//Ϊָ¶¨½ÚµãÌí¼Ó×Ó½Úµã
root.AppendChild(node);
//»ñÈ¡Ö¸¶¨½ÚµãµÄÖ¸¶¨ÊôÐÔÖµ
string id=node.Attributes["id"].Value;
//»ñÈ¡Ö¸¶¨½ÚµãÖеÄÎı¾
string content=node.InnerText;
//±£´æXMLÎļþ
string path=Server.MapPath("~/file/bookstore.xml");
xml.Save(path);
//or use :xml.Save(HttpContext.Current.Server.MapPath("~/file/bookstore.xml"));
¶þ¡¢¾ßÌåʵÀý
ÔÚC#.netÖÐÈçºÎ²Ù×÷XML
ÐèÒªÌí¼ÓµÄÃüÃû¿Õ¼ä£º
using System.Xml;
¶¨Ò弸¸ö¹«¹²¶ÔÏó£º
XmlDocument xmldoc ;
XmlNode xmlnode ;
XmlElement xmlelem ;
1£¬´´½¨µ½·þÎñÆ÷ͬÃûĿ¼ÏµÄxmlÎļþ£º
·½·¨Ò»£º
xmldoc = new XmlDocument ( ) ;
//¼ÓÈëXMLµÄÉùÃ÷¶ÎÂä,<?xml version="1.0" encoding="gb2312"?>
XmlDeclaration xmldecl;
xmldecl = xmldoc.CreateXmlDeclaration("1.0","gb2312",null);
xmldoc.AppendChild ( xmldecl);
//¼ÓÈëÒ»¸ö¸ùÔªËØ
xmlelem = xmldoc.CreateElement ( "" , "Employees" , "" ) ;
xmldoc.AppendChild ( xmlelem ) ;
//¼ÓÈëÁíÍâÒ»¸öÔªËØ
for(int i=1;i<3;i++)
{
XmlNode root=xmldoc.SelectSingleNode("Employees");//²éÕÒ<Employees>
XmlElement xe1=xmldoc.CreateElement("Node");//´´½¨Ò»¸ö<Node>½Ú


Ïà¹ØÎĵµ£º

ĬÈÏÖ»ÄÜÉÏ´«2M¸½¼þ, ÈçºÎ·Å¿ªÏÞÖÆ? (asp.net C#)

 
¶ÔÓÚasp.net,ĬÈÏÖ»ÔÊÐíÉÏ´«2MÎļþ,Ôö¼ÓÈçÏÂÅäÖÃ,Ò»°ã¿ÉÒÔ×Ô¶¨Òå×î´óÎļþ´óС.
<httpRuntime executionTimeout="300" maxRequestLength="40960" useFullyQualifiedRedirectUrl="false"/>
ÎÒÃÇÔÚÉÏ´«´óÎļþʱ¶¼Óöµ½¹ýÕâÑù»òÄÇÑùµÄÎÊÌâ¡£ÉèÖúܴóµÄmaxRequestLengthÖµ²¢²»ÄÜÍê ......

Asp.Net ºº×Öת»»Æ´Òô

public class chs2py
{
 public chs2py()
 {
  //
  //TODO: ÔÚ´Ë´¦Ìí¼Ó¹¹Ô캯ÊýÂß¼­
  //
 }
    private static int[] pyvalue = new int[]{-20319,-20317,-20304,-20295,-20292,-20283,-20265,-20257,-20242,-20230,-20051,-20036,-20032,-20026,& ......

ASP.NET

ËÄ¡¢ÈçºÎ£ºÖ¸¶¨ÊÇ·ñ½« ASP.NET Web ·þÎñÆ÷¿Ø¼þ·¢Ë͵½·þÎñÆ÷
      ĬÈÏÇé¿öÏ£¬Óû§ÔÚ ASP.NET ÍøÒ³ÖÐÖ¸¶¨µÄÐÅÏ¢ºÍÑ¡Ôñ²»»áÁ¢¼´·¢Ë͵½·þÎñÆ÷¡£¶øÊÇÖ»ÔÚ·¢ËÍÕû¸öҳʱ·¢ËÍÖµ£¬²¢ÇÒͨ³£ÊÇÔÚÏìÓ¦°´Å¥µ¥»÷ʱ·¢Éú¡£µ«ÊÇ£¬Äú¿ÉÄܻᷢÏÖËüÔÚÏò·þÎñÆ÷Á¢¼´·¢ËÍÓû§¸ü¸Äʱ·Ç³£ÓÐÓá£
Á¢¼´½«¿Ø¼þÖµ·¢Ë͵½·þÎ ......

ASP.NET

°Ë¡¢ASP.NET Web ·þÎñÆ÷¿Ø¼þÄ£°å
      ´ó¶àÊý Web ·þÎñÆ÷¿Ø¼þ¾ßÓÐĬÈϵIJ¼¾ÖºÍÍâ¹Û£¬µ«ÊÇÄú¿ÉÒÔͨ¹ýÉèÖÃÊôÐÔ»òʹÓÃÑùʽÀ´²Ù×ÝËüÃÇ¡£²¿·Ö Web ·þÎñÆ÷¿Ø¼þ»¹ÔÊÐíÄúʹÓÃÄ£°åÀ´×Ô¶¨ÒåÆäÍâ¹Û¡£
Ä£°åÊÇÒ»×é HTML ÔªËغͿؼþ£¬ËüÃǹ¹³É¿Ø¼þÌض¨²¿·ÖµÄ²¼¾Ö¡£ÀýÈ磬ÔÚ DataList Web ·þÎñÆ÷¿Ø¼þÖУ¬Äú¿ÉÒ ......

ASP.NET

¾Å¡¢ÒÔ±à³Ì·½Ê½Ìí¼Ó ASP.NET ¿Ø¼þ
      ÓÐʱ£¬ÔÚÔËÐÐʱ´´½¨¿Ø¼þ±ÈÔÚÉè¼Æʱ´´½¨¿Ø¼þ¸ü¿ÉÐС£ÀýÈ磬¼Ù¶¨ÓÐÒ»¸öËÑË÷½á¹ûÒ³£¬ÄúÒªÔÚÆäÖн«ÒÔ±íµÄÐÎʽÏÔʾ½á¹û¡£ÓÉÓÚ²»ÖªµÀÒª·µ»Ø¶àÉÙÏÒò´ËÄúÐèҪÿ¸ö·µ»ØµÄÏ̬Éú³ÉÒ»¸ö±íÐС£
      ˵Ã÷£º ÏÖÓпؼþͨ³£¿ÉÒÔÌṩ´Ó¶¯ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ