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

VB.NETÖвÙ×÷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>½Úµã£º
Dim xmlDoc As New XmlDocument()
xmlDoc.Load("bookstore.xml")
Dim root As XmlNode = xmlDoc.SelectSingleNode("bookstore") '²éÕÒ<bookstore>
Dim xe1 As XmlElement = xmlDoc.CreateElement("book") '´´½¨Ò»¸ö<book>½Úµã
xe1.SetAttribute("genre", "ÀîÔÞºì") 'ÉèÖøýڵãgenreÊôÐÔ
xe1.SetAttribute("ISBN", "2-3631-4") 'ÉèÖøýڵãISBNÊôÐÔ
Dim xesub1 As XmlElement = xmlDoc.CreateElement("title")
xesub1.InnerText = "CS´ÓÈëÃŵ½¾«Í¨" 'ÉèÖÃÎı¾½Úµã
xe1.AppendChild(xesub1) 'Ìí¼Óµ½<book>½ÚµãÖÐ
Dim xesub2 As XmlElement = xmlDoc.CreateElement("author")
xesub2.InnerText = "ºò½Ý"
xe1.AppendChild(xesub2)
Dim xesub3 As XmlElement = xmlDoc.CreateElement("price")
xesub3.InnerText = "58.3"
xe1.AppendChild(xesub3)
root.AppendChild(xe1) 'Ìí¼Óµ½<bookstore>½ÚµãÖÐ
xmlDoc.Save("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>
<book genre="ÀîÔÞºì" ISBN="2-3631-4">
<title>CS´ÓÈëÃŵ½¾«Í¨</title>
<author>ºò½Ý</author>
<price>58.3</price>
</book>
</bookstore>
2¡¢Ð޸Ľڵ㣺½«genreÊôÐÔֵΪ“ÀîÔ޺쓵ĽڵãµÄgenreÖµ¸ÄΪ“updateÀîÔ޺씣¬½«¸Ã½ÚµãµÄ×Ó½Úµã<author>µÄÎı¾ÐÞ¸ÄΪ“ÑÇʤ”¡£
Dim nodeList As XmlNodeList = xmlDoc.SelectSingleNode("bookstore").ChildNodes '»ñÈ¡bookstore½ÚµãµÄËùÓÐ×Ó½Úµã
Dim xn As XmlNode
For Each


Ïà¹ØÎĵµ£º

VB —ÍòÄêÀúʵÀý (2)

Éϼ¯ÖÐÖ»ÊÇÏÔʾÐÇÆÚ¼¸£¬²»¹»È«Ã棬ÍêÉÆºóÈçÏ£º
1¡¢´´½¨lbl1¡¢lbl2¡¢lbl3¡¢txt1¡¢cmd1¡¢Timer1
2¡¢lbl£º“ÊäÈëÄêÔÂÈÕ£¨Èç2000-8-16£©£º”£¬ÉèÖÃlbl¡¢txt1¡¢cmd1µÄ×ÖÌå´óСºÍÑÕÉ«¡£Timer1µÄEnableÊôÐÔÉèΪFalse£¬IntervalÊôÐÔÉèΪ£º1000¡£
3¡¢Ë«»÷cmd1£¬½øÈë´úÂë±à¼­´°¿Ú£¬ÇÃÈ룺
Private Sub Timer1_Timer() ......

VBʵÀý —ÍòÄêÀú £¨1£©

1¡¢´´½¨¿Ø¼þ£ºlbl1¡¢txt1¡¢lbl2¡¢cmd1
2¡¢lbl1.caption=ÊäÈëÈÕÆÚ£¨ÈÎÒ»ÖÖÕýÈ·¸ñʽ£©£º
ÉèÖÃlbl1¡¢txt1¡¢lbl2¡¢cmd1µÄ×ÖÌå´óС¼°ÑÕÉ«£»
3¡¢Ë«»÷°´Å¥“È·ÈÏ”£¬Ìí¼Ó´úÂ룬Ч¹ûΪ£º
    Option Explicit
        Private Sub cmd1_Click()
  &nb ......

vb³£ÓõÄÄÚ²¿º¯Êý£¨¶þ£©£º×Ö·û´®º¯Êý


len£¨string£©£º¼ÆËã×Ö·û´®³¤¶Èº¯Êý¡£·µ»Ø×Ö·û´®stringÖÐ×Ö·ûµÄ¸öÊý¡£Ò»¸öºº×ÖΪһ¸ö×Ö·û£¬¿Õ¸ñҲΪһ¸ö×Ö·û£¬¿Õ×Ö·û´®µÄ³¤¶ÈΪ0.
Ltrim£¨string£©¡¢Rtrim£¨string£©¡¢Trim£¨string£©£º
Ltrim£¨string£©º¯Êý¹¦ÄÜÊÇ·µ»ØÉ¾³ýÁË×Ö·û´®string×ó±ß¿Õ¸ñÖ®ºóÊ£ÓàµÄ²¿·Ö¡£
Rtrim£¨string£©º¯Êý¹¦ÄÜÊÇ·µ»ØÉ¾³ýÁË×Ö·û´®ÖÐstringÓ ......

flash¶ÁÈ¡xmlÊý¾ÝÏÔʾͼƬÔÚ»ðºüÖв»ÄÜÕý³£ÏÔʾµÄÎÊÌâ

ÔÚhtmlÎļþÖÐǶÈëµÄ´úÂëÈçÏÂ:
<script type="text/javascript">
var xmlUrl="news.xml";
var swfURL="news.swf";
var img_Speed=2;
var page_Speed=3000;
var TextPosition="down";
var HeadlineColor="#ff0000";
var HeadlineFont="14px";
va ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ