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

c#xmlµÄÔöɾ¸Ä²é


ÒÑÖªÓÐÒ»¸öXMLÎļþ£¨bookstore.xml£©ÈçÏ£º  
  <?xml   version="1.0"   encoding="gb2312"?>  
  <bookstore>  
      <book   genre="fantasy"   ISBN="2-3631-4">  
          <title>Oberon's   Legacy</title>  
          <author>Corets,   Eva</author>  
          <price>5.95</price>  
      </book>  
  </bookstore>  
     
  1¡¢Íù<bookstore>½ÚµãÖвåÈëÒ»¸ö<book>½Úµã£º  
        XmlDocument   xmlDoc=new   XmlDocument();  
        xmlDoc.Load("bookstore.xml");  
        XmlNode   root=xmlDoc.SelectSingleNode("bookstore");//²éÕÒ<bookstore>  
        XmlElement   xe1=xmlDoc.CreateElement("book");//´´½¨Ò»¸ö<book>½Úµã  
        xe1.SetAttribute("genre","ÀîÔÞºì");//ÉèÖøýڵãgenreÊôÐÔ  
        xe1.SetAttribute("ISBN","2-3631-4");//ÉèÖøýڵãISBNÊôÐÔ  
     
        XmlElement   xesub1=xmlDoc.CreateElement("title");  
        xesub1.InnerText="CS´ÓÈëÃŵ½¾«Í¨";//ÉèÖÃÎı¾½Úµã  
        xe1.AppendChild(xesub1);//Ìí¼Óµ½<book>½ÚµãÖÐ  
        XmlElement   xesub2=xmlDoc.CreateElement("author");  
        xesub2.InnerText="ºò½Ý";  
        xe1.AppendChild(xesub2);  
        XmlElement   xesub3=xmlDoc.CreateElement("price");  
        xesub3.InnerText="58.3";  
        xe1.AppendChild(xesub


Ïà¹ØÎĵµ£º

StringºÍXmlÖ®¼äµÄת»»¡¢StringתInputStream

ͨ³£ÔÚ²Ù×÷xmlµÄʱºò£¬¶¼ÊÇͨ¹ýinputstream£¨ºÜ¶àÇé¿öÏÂÊÇFileInputStream£©À´¶ÁÈëxml²¢×ªÎªdomµÄ£¬ºÜ¶àÈË»áÓöµ½ÕâÖÖÇé¿öÊý¾Ý²»ÊÇ´ÓÎļþ¶ÁÈëµÄ¶øÊÇ´ÓStringÖÐÈ¡µÃµÄ
ÓÚÊÇ»áʹÓÃ
InputStream in = new ByteArrayInputStream (str.getBytes());À´È¡µÃinputstream £¬µ«ÊÇÕâÖÖInputStreamÖÐÊý¾Ý±»×ª³ÉÁËbyteÊý×飬ËùÒÔתdom ......

C#ÖжÔXML½Úµã½øÐÐÔöɾ¸Ä²é

ºÅ³ÆxmlhelperµÄÒ»¸öÀà
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Xml;
namespace WebApplication2
{
/// <summary>
/// XMLHelper XMLÎĵµ²Ù×÷¹ÜÀíÆ÷
/// </summary>
public class XMLHelper
{
public X ......

ÈçºÎ¼ÆËãMS SQLÓï¾äÖ´ÐеÄʱ¼ä»¹ÓÐc#


MSSQL:
declare @begin datetime
declare @End datetime
set @begin=getdate()
   --Ö´ÐеÄÓï¾äдÔÚÕâÀï
set @End=getdate()
select datediff(millisecond,@begin,@End) as Ö´ÐеÄʱ¼ä
--millisecond±íʾºÁÃë Èç¹û¿´Ãë¿ÉÒÔʹÓÃss
C#:
ºÜ¶àʱº ......

C#¶ÁдAccessÊý¾Ý¿âµÄOLE¶ÔÏó×Ö¶Î

£¨Ò»£©°ÑÎļþÄÚÈÝдÈëAccessÊý¾Ý¿âµÄOLE¶ÔÏó×Ö¶ÎÖУº
if (File.Exists(txtBrow.Text) != false)   // Îı¾¿òtxtBrowÖÐÄÚÈÝΪÎļþ·¾¶¼°ÎļþÃû
{
     //»ñÈ¡Îļþºó׺
     FileInfo p = new FileInfo(txtBrow.Text.Trim());
     F_str_Type = ......

¸üРxml²½Öè

ÔÚservice(spring)ÖÐÍê³É
step 1:
´ò¿ªÒ»¸ösession
д sql Óï¾ä£¬
×¢Òâµã£ºÐ´sqlÓï¾äʱ,Ëù²éѯµÄÊÔͼΪ£ºkangaroo_VW_UnitView£¬´ËÊÔͼµÄÉú³É
ÓÐ kangaroo_unit±í×óÁ¬½Óµ½kangaroo_img±í¶øÉú³É¡£
step 2:
°ÑËù²éѯµÄ·ûºÏÌõ¼þµÄ¼¯ºÏ·ÅÈëÁÙʱµÄArrayListÖУ¬²¢¶ÔÁÙʱµÄArrayList½øÐÐ
µü´ú¡£
step 3:
°Ñµü´ú³öÀ´µÄ¼¯ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ