隨筆 - 8  文章 - 55  trackbacks - 0
          <2006年5月>
          30123456
          78910111213
          14151617181920
          21222324252627
          28293031123
          45678910

          常用鏈接

          留言簿(6)

          隨筆分類

          隨筆檔案

          文章分類

          文章檔案

          朋友的Blog

          最新評論

          閱讀排行榜

          評論排行榜

          vbs類生成xml文件
          [ 作者:??加入時間:2006-04-03 15:13:42??來自: ]
          有兩文件:
          obj
          XML . asp :測試文件
          cls
          XML . asp :vbs類文件
          代碼:
          obj
          XML . asp

          <%@ Language=VBScript %>
          <% Option Explicit %>
          <!--#INCLUDE FILE="cls
          XML . asp "-->
          <%
          Dim obj
          XML , strPath, str
          Set obj
          XML = New cls XML

          strPath = Server.MapPath(".") & "/New.xml"

          obj XML .createFile strPath, "Root"
          'Or If using an existing
          XML file:
          'obj
          XML .File = "C:/File.xml"

          obj XML .createRootChild "Images"

          'Here only one attribute is added to the Images/Image Node
          obj
          XML .createChildNodeWAttr "Images", "Image", "id", "1"
          obj
          XML .updateField "Images//Image[@id=1]", "super.gif"
          obj
          XML .createRootNodeWAttr "Jobs", Array("Size", "Length", "Width"), _
          Array(24, 31, 30)
          obj
          XML .createRootNodeWAttr "Jobs", Array("Size", "Length", "Width"), _
          Array(24, 30, 29)
          obj
          XML .createRootNodeWAttr "Jobs", Array("Size", "Length", "Width"), _
          Array(24, 31, 85)

          'Notice that all three job nodes have size 24, all of those
          'nodes will be updated
          obj
          XML .updateField "Jobs[@Size=24]", "24's"

          'Notice that only two nodes have the specified XPath, hence
          'only two new child nodes will be added
          obj
          XML .createChildNodeWAttr "Jobs[@Size=24 and @Length=31]", "Specs", _
          Array("Wood", "Metal", "Color"), _
          Array("Cedar", "Aluminum", "Green")

          'It is always important to iterate through all of the nodes
          'returned by this XPath query.
          For Each str In obj
          XML .getField("Jobs[@Size=24]")
          Response.Write(str & "<br>")
          Next
          Set obj
          XML = Nothing

          Response.Redirect "New.xml"
          %>

          cls XML . asp :

          <%
          Class cls
          XML
          'strFile must be full path to document, ie C:/ XML / XML File. XML
          'objDoc is the XML Object
          Private strFile, objDoc

          '*********************************************************************
          ' Initialization/Termination
          '*********************************************************************

          'Initialize Class Members
          Private Sub Class_Initialize()
          strFile = ""
          End Sub

          'Terminate and unload all created objects
          Private Sub Class_Terminate()
          Set objDoc = Nothing
          End Sub

          '*********************************************************************
          ' Properties
          '*********************************************************************

          'Set XML File and objDoc
          Public Property Let File(str)
          Set objDoc = Server.CreateObject("Microsoft.
          XML DOM")
          objDoc.async = False
          strFile = str
          objDoc.Load strFile
          End Property

          'Get XML File
          Public Property Get File()
          File = strFile
          End Property

          '*********************************************************************
          ' Functions
          '*********************************************************************

          'Create Blank XML File, set current obj File to newly created file
          Public Function createFile(strPath, strRoot)
          Dim objFSO, objTextFile
          Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
          Set objTextFile = objFSO.CreateTextFile(strPath, True)
          objTextFile.WriteLine("<?xml version=""1.0""?>")
          objTextFile.WriteLine("<" & strRoot & "/>")
          objTextFile.Close
          Me.File = strPath
          Set objTextFile = Nothing
          Set objFSO = Nothing
          End Function

          'Get XML Field(s) based on XPath input from root node
          Public Function getField(strXPath)
          Dim objNodeList, arrResponse(), i
          Set objNodeList = objDoc.documentElement.selectNodes(strXPath)
          ReDim arrResponse(objNodeList.length)
          For i = 0 To objNodeList.length - 1
          arrResponse(i) = objNodeList.item(i).Text
          Next
          getField = arrResponse
          End Function

          'Update existing node(s) based on XPath specs
          Public Function updateField(strXPath, strData)
          Dim objField
          For Each objField In objDoc.documentElement.selectNodes(strXPath)
          objField.Text = strData
          Next
          objDoc.Save strFile
          Set objField = Nothing
          updateField = True
          End Function

          'Create node directly under root
          Public Function createRootChild(strNode)
          Dim objChild
          Set objChild = objDoc.createNode(1, strNode, "")
          objDoc.documentElement.appendChild(objChild)
          objDoc.Save strFile
          Set objChild = Nothing
          End Function

          'Create a child node under root node with attributes
          Public Function createRootNodeWAttr(strNode, attr, val)
          Dim objChild, objAttr
          Set objChild = objDoc.createNode(1, strNode, "")
          If IsArray(attr) And IsArray(val) Then
          If UBound(attr)-LBound(attr) <> UBound(val)-LBound(val) Then
          Exit Function
          Else
          Dim i
          For i = LBound(attr) To UBound(attr)
          Set objAttr = objDoc.createAttribute(attr(i))
          objChild.setAttribute attr(i), val(i)
          Next
          End If
          Else
          Set objAttr = objDoc.createAttribute(attr)
          objChild.setAttribute attr, val
          End If
          objDoc.documentElement.appendChild(objChild)
          objDoc.Save strFile
          Set objChild = Nothing
          End Function

          'Create a child node under the specified XPath Node
          Public Function createChildNode(strXPath, strNode)
          Dim objParent, objChild
          For Each objParent In objDoc.documentElement.selectNodes(strXPath)
          Set objChild = objDoc.createNode(1, strNode, "")
          objParent.appendChild(objChild)
          Next
          objDoc.Save strFile
          Set objParent = Nothing
          Set objChild = Nothing
          End Function

          'Create a child node(s) under the specified XPath Node with attributes
          Public Function createChildNodeWAttr(strXPath, strNode, attr, val)
          Dim objParent, objChild, objAttr
          For Each objParent In objDoc.documentElement.selectNodes(strXPath)
          Set objChild = objDoc.createNode(1, strNode, "")
          If IsArray(attr) And IsArray(val) Then
          If UBound(attr)-LBound(attr) <> UBound(val)-LBound(val) Then
          Exit Function
          Else
          Dim i
          For i = LBound(attr) To UBound(attr)
          Set objAttr = objDoc.createAttribute(attr(i))
          objChild.SetAttribute attr(i), val(i)
          Next
          End If
          Else
          Set objAttr = objDoc.createAttribute(attr)
          objChild.setAttribute attr, val
          End If
          objParent.appendChild(objChild)
          Next
          objDoc.Save strFile
          Set objParent = Nothing
          Set objChild = Nothing
          End Function

          'Delete the node specified by the XPath
          Public Function deleteNode(strXPath)
          Dim objOld
          For Each objOld In objDoc.documentElement.selectNodes(strXPath)
          objDoc.documentElement.removeChild objOld
          Next
          objDoc.Save strFile
          Set objOld = Nothing
          End Function
          End Class
          %>

          posted @ 2006-06-06 13:04 blog搬家了--[www.ialway.com/blog] 閱讀(426) | 評論 (0)編輯 收藏

          www.nike.com

          www.m5.icoke.com

          http://www.hcgjhotel.com/

          http://www.peugeot.com.cn/web/307/

          http://www.kingnare.com/

          http://www.greenovia.net/

          http://www.blueidea.com/bbs/newsdetail.asp?page=4&id=1935698&Daysprune=&lp=1

          http://www.5dmax.com/

          http://www.skii.com.cn/pitera/index.html

          http://www.daphne.com.cn/d28/

          http://www.wangbao.com.cn/main.html

          http://www.mystvgame.com/us/

          http://land.anycall.com/event/anyclub2/event_main.jsp

          http://www.gglc.com.cn/main.htm

          http://www.boyaguoji.com/index1.htm

          www.superaction.co.kr

          posted @ 2006-06-03 21:34 blog搬家了--[www.ialway.com/blog] 閱讀(410) | 評論 (0)編輯 收藏
          QQ罵人寶典7
          作者:未知 來源:99軟件站 加入時間:2004-8-28 飛牌精品軟件
           
          男人的四大理想:天上紛紛掉鈔票,天下美男都死掉,美女腦子都壞掉,哭著喊著讓我泡.

          丑女一回頭,嚇死一頭牛;丑女二回頭,黃河瀑布水倒流;丑女三回頭,泰森改打乒乓球!

          男人四怕:怕小姐有病,怕情人懷孕,怕群眾寫信,怕老婆自盡。你怕啥?

          這段日子以來,我一直想對你說三個字,但又怕說了連普通朋友也做不成,可我控制不住,還是想說:借點錢!

          腦筋急轉彎:一只豬過馬路被車撞死了,為什么?告訴你吧,是豬不會急轉彎。

          老婆無味,情人太累,小姐太貴,沒事開個同學會,拆散一對是一對

          克林頓睡覺是國睡 乞丐睡覺是地稅 和老婆睡覺是依法納稅 和情人睡覺是偷稅漏稅 和小姨子睡覺是增值稅

          讀出下面的字,你將獲得月薪2000000的工作,試題如下:簟璁醭歙艽绱癀穡魍旃傯彘硪钚鰣硐蓰。

          警告。你的手機由于黑客侵入信號系統,電池即將被引爆。請立即將手機電池取下扔出五米距離。切切。

          兄弟!請不要在每次放屁后低頭猛吸就以為能把屁味吸光!:p

          啊!你的皮膚如此富有光澤,你散發的香味如此難以抗拒,讓我狠狠咬你一口吧,我親愛的--紅燒肉。

          人家撈,你不撈,老婆說你是草包;人家賭,你不賭,背后說你二百五;人家嫖,你不嫖,大伙一起造你謠

          人生四大悲:久旱逢甘霖-不停;他鄉遇故知-借錢;洞房花燭夜-不舉;金榜題名時-別人

          豬的四大愿望:四周柵欄都倒掉,天上紛紛掉飼料。天下屠夫都死掉,世界人民信佛教。

          天大地大不如老婆大;爹親娘親不如小姐親;千好萬好不如二奶好!

          只愛一個有點傻,愛上兩個最起碼,三個五個剛合適,十個八個才瀟灑。

          山外青山樓外樓,你不愛我我不愁。世上美女到處有,她會比你更溫柔!

          投保:男朋友是準客戶,老公是客戶,結婚是簽單,離婚是退保,再婚是續保,找老二是加保  

          這是有“屎”以來最有“糞”量的祝福

          有三個字一直藏在我的心底不敢對你說。現在我終于鼓足了勇氣:“去死吧!”  

          那天我看見你拿到狂砍一只豬,豬跑到一個死胡同,只聽見豬大叫:“本是同根生,相煎何太急!”

          你如果收到本信息,證明你手機以感染病毒,請馬上取出手機卡,用汽油刷洗。

          網上無計可消愁,聊天解煩憂,忽見美眉在招手,頓首頓首,關掉其他窗口,聊到最后,是一北方老叟,作嘔作嘔!

          不許動!搶劫!全部舉起手來!男的站左邊,女的站右邊,變態的站中間,哎!說的就是你,還裝著看手機!

          美眉美眉我愛你!先用話語感動你,再用行動打動你,買個戒指送給你,再用勞斯萊斯去娶你!(你愿意嗎?)

          嫖客:萬水千山總是情,少給十塊行不行;妓女:人間哪有真情在,多賺十塊是十塊。

          有一個女生去牧場見習擠牛奶,可別人都擠了一桶了,她還只擠了一點,正著急,突然老牛說了:小姐,你擠錯地方了!

          強匪發現保險柜里頭全都是果凍,他一氣之下,把所有果凍都吃掉。隔天報紙的頭條是這么寫的 ※瘋狂歹徒,精子銀行被盜※

          獵人發現一只豬,舉起獵槍打死了豬,獵人走近豬,豬卻起來了,知道為什么?猜不到?—豬也正納悶呢。

          男人最渴望的一句話:“我要”;男人最恐懼的一句話:“我還要嘛”

          請走到最近的電線桿前面,對著上面的野廣告大聲說“我的病有救了”

          你比鏡子還能反映我的缺點,你比莊子還博學多才,你比孫子還有謀略。所以我們都親切的叫你:“鏡莊孫子”。

          網上自古少嬌娘,歪瓜裂棗排成行,偶爾幾聲鴛鴦叫,也是淫女配色狼. 
          posted @ 2006-05-31 12:46 blog搬家了--[www.ialway.com/blog] 閱讀(853) | 評論 (0)編輯 收藏
          主站蜘蛛池模板: 平谷区| 澄江县| 镇安县| 永寿县| 绥中县| 徐汇区| 蚌埠市| 会同县| 南京市| 鄂托克前旗| 微山县| 建平县| 喜德县| 曲阜市| 福清市| 泊头市| 册亨县| 肃宁县| 甘孜| 寿宁县| 昭苏县| 长垣县| 军事| 博爱县| 宜良县| 瑞丽市| 介休市| 禄劝| 台东市| 临泽县| 天等县| 桓仁| 错那县| 眉山市| 洱源县| 井冈山市| 望城县| 东阿县| 民和| 秦安县| 双流县|