IIS5 + ADO 2.5新先睹为快技术(一)
网络整理 - 09-10
在IIS5(就是安装了Win2000)中自带了新的ADO 2.5版本尤其增加了对XML技术的支持,并且带入了许多崭新的技术,这些技术可以
帮助我们实现以前必须要依靠组件或者其它技术才能够实现的功能。
我这里做一个简单的介绍让大家对这个新的Web组合有所了解。
从这可以看出,学习和掌握XML技术已经迫在眉睫了。欢迎大家到隔壁
的XML学习园地作客。。。
新技术之一:
ADO中新增加了一个Record对象(别和RecordSet对象混淆了)。。。
它可以操纵服务器上的任何文件。。。
下面是它运用的事例:
<%
Dim recRoot
Dim rsFiles
Set recRoot = Server.CreateObject("ADODB.Record")
'注意打开的URL必须是运行IIS5中或者支持WebDAV服务,
'至于什么是WebDAV请到隔壁去看看把
recRoot.open "", "URL=http://localhost/iis", adModeRead
Response.Write "<UL>" & Chr(13) & Chr(10)
TraverseTree recRoot
Response.Write "</ul>" & Chr(13) & Chr(10)
recRoot.Close
set recRoot = Nothing
Sub TraverseTree(recNode)
Dim rsChildren
Dim recChildNode
Set recChildNode = Server.CreateObject("ADODB.Record")
Response.Write "<LI>" & recNode("RESOURCE_PARSENAME") & Chr(13) & Chr(10)
Set rsChildren = recNode.GetChildren
If Not rsChildren.EOF Then
Response.Write "<UL>" & Chr(13) & Chr(10)
While Not rsChildren.EOF
If rsChildren("RESOURCE_ISCOLLECTION") Then
recChildNode.Open rsChildren
TraverseTree recChildNode
recChildNode.Close
Else
Response.Write "<LI>" & rsChildren("RESOURCE_PARSENAME") & Chr(13) & Chr(10)
End If
rsChildren.MoveNext
Wend
Response.Write "</UL>" & Chr(13) & Chr(10)
End If
rsChildren.Close
Set rsChildren = Nothing
Set recChildNode = Nothing
End Sub
%>
考虑到很多人目前没有安装Win2000,所以我把运行结果也给出来了,
大家可以看到代码运行的结果。。。
注意要想得到正确的结果必须要让iis目录可以Directory Browing
<UL>
<LI>iis
<UL>
<LI>sdk
<UL>
<LI>admin
<UL>
<LI>mkwebsrv.vbs
<LI>mkwebsrv.js
<LI>metabackrest.vbs
<LI>metabackrest.js
<LI>metaback.vbs
<LI>metaback.js
<LI>logenum.vbs
<LI>logenum.js
</UL>
<LI>asp
<UL>
<LI>applications
<UL>
<LI>Session_VBscript.asp
<LI>Session_Jscript.asp
<LI>Application_VBscript.asp
<LI>Application_Jscript.asp
</UL>
<LI>components
<UL>
<LI>redirect.asp
<LI>nts_iis.gif
<LI>ie.gif
<LI>clientcap.htm
<LI>BrowserCap_VBscript.asp
<LI>BrowserCap_Jscript.asp
<LI>AdRotator_VBscript.asp
<LI>AdRotator_Jscript.asp
<LI>adrot.txt
</UL>
<LI>database
<UL>
<LI>Update_VBscript.asp
<LI>Update_Jscript.asp
<LI>StoredProcedures_VBscript.asp
<LI>StoredProcedures_Jscript.asp
<LI>SimpleQuery_VBscript.asp
<LI>SimpleQuery_Jscript.asp
<LI>MultiScrolling_VBscript.asp
<LI>MultiScrolling_Jscript.asp
<LI>LimitRows_VBscript.asp
<LI>LimitRows_Jscript.asp
<LI>Authors.mdb
<LI>AddDelete_VBscript.asp
<LI>AddDelete_Jscript.asp
</UL>
<LI>docs
<UL>
<LI>toolbar.asp
<LI>sampfram.asp
<LI>libcodebrws.inc
<LI>ColorPicker.asp
<LI>CodeBrws.asp
</UL>
<LI>interaction
<UL>
<LI>ServerVariables_VBscript.asp
<LI>ServerVariables_Jscript.asp
<LI>Redirect_VBscript.asp
<LI>Redirect_Jscript.asp
<LI>QueryString_VBscript.asp
<LI>QueryString_Jscript.asp
<LI>PopulateForm_VBscript.asp
<LI>PopulateForm_Jscript.asp
<LI>Pics_VBscript.asp
<LI>Pics_Jscript.asp
<LI>Logon_VBscript.asp
<LI>Logon_Jscript.asp
<LI>Form_VBscript.asp
<LI>Form_Jscript.asp
<LI>FileList.txt
<LI>Expire_VBscript.asp
<LI>Expire_Jscript.asp
<LI>Cookie_VBscript.asp
<LI>Cookie_Jscript.asp
<LI>Clientscript_VBscript.asp
<LI>Clientscript_Jscript.asp
</UL>
<LI>simple
<UL>
<LI>Variables_VBscript.asp
<LI>Variables_Jscript.asp
<LI>Looping_VBscript.asp
<LI>Looping_Jscript.asp
<LI>Includes_VBscript.asp
<LI>Includes_Jscript.asp
<LI>HeaderInfo.asp
<LI>Functions_VBscript.asp
<LI>Functions_Jscript.asp
<LI>Conditional_VBscript.asp
<LI>Conditional_Jscript.asp
<LI>Arrays_VBscript.asp
<LI>Arrays_Jscript.asp
</UL>
<LI>transactional
<UL>
<LI>SimpleTransaction_VBscript.asp
<LI>SimpleTransaction_Jscript.asp
<LI>FundTransfer_VBscript.asp
</UL>
</UL>
</UL>
<LI>homepage
<UL>
<LI>themes
<UL>
<LI>gunmetal
<UL>
<LI>setup.inc
<LI>layout.inc
<LI>layout.css
<LI>gradient.gif
</UL>
<LI>journal
<UL>
<LI>setup.inc
<LI>rip3.gif
<LI>rip2_2.gif
<LI>layout.inc
<LI>layout.css
</UL>
<LI>looseleaf
<UL>
<LI>setup.inc
<LI>layout.inc
<LI>layout.css
</UL>
</UL>
<LI>themes.inc
<LI>theme.inc
<LI>sub.inc
<LI>signbook.asp
<LI>myfiles.asp
<LI>guestbk.asp
<LI>global.asa
<LI>file.gif
<LI>default.asp
<LI>bullet.gif
</UL>
<LI>global.asa
</UL>
</ul>