检测站点是否支持组件
#1?牐牸觳夤ぞ撸?
?牐燙heckObj.asp代码如下:
?牐?<% @ Language="VBScript" %>
?牐?<% Option Explicit %>
?牐?<%
?牐牐? 这是随IIS4附带的一些组件(默认的)
?牐燚im theInstalledObjects(8)
?牐爐heInstalledObjects(0)= "MSWC.AdRotator"
?牐爐heInstalledObjects(1)= "MSWC.BrowserType"
?牐爐heInstalledObjects(2)= "MSWC.NextLink"
?牐爐heInstalledObjects(3)= "MSWC.Tools"
?牐爐heInstalledObjects(4)= "MSWC.Status"
?牐爐heInstalledObjects(5)= "MSWC.Counters"
?牐爐heInstalledObjects(6)= "IISSample.ContentRotator"
?牐爐heInstalledObjects(7)= "IISSample.PageCounter"
?牐爐heInstalledObjects(8)= "MSWC.PermissionChecker"
?牐燜unction IsObjInstalled(strClassString)
?牐燨n Error Resume Next
?牐營sObjInstalled = False
?牐燛rr = 0
?牐燚im xTestObj
?牐燬et xTestObj = Server.CreateObject(strClassString)
?牐營f 0 = Err Then IsObjInstalled = True
?牐燬et xTestObj = Nothing
?牐燛rr = 0
?牐燛nd Function
?牐?%>
?牐?<HTML>
?牐?<HEAD>
?牐?<TITLE>检测ISP是否支持ASP组件的工具</TITLE>
?牐?</HEAD>
?牐?<BODY>
?牐犜谙旅娴氖淙肟蛑惺淙肽阋觳獾淖榧腜rogId或ClassId.
?牐犎绻忝挥惺淙氲幕埃褂媚现怠?
?牐?<FORM action=<%=Request.ServerVariables("SCRIPT_NAME")%> method=post>
?牐?<input type=text value="" name="classname" size=40>
?牐?<INPUT type=submit value=Submit>
?牐?<INPUT type=reset value=Reset>
?牐?</FORM>
?牐?<%
?牐燚im strClass
?牐爏trClass = Trim(Request.Form("classname"))
?牐營f "" <> strClass then
?牐燫esponse.Write strClass & "*"
?牐營f Not IsObjInstalled(strClass)then
?牐燫esponse.Write "<strong>没有安装,本主页提供站点不支持这个组件</strong>"
?牐燛lse
?牐燫esponse.Write "安装了,本主页提供站点支持使用这个组件!"
?牐燛nd If
?牐燫esponse.Write "<P>" & vbCrLf
?牐燛lse
?牐?%>
?牐?<TABLE BORDER=0>
?牐?<%
?牐燚im i
?牐燜or i=0 to UBound(theInstalledObjects)??
?牐燫esponse.Write "<TR><TD>" & theInstalledObjects(i)& "</TD><TD>"
?牐營f Not IsObjInstalled(theInstalledObjects(i)) Then
?牐燫esponse.Write "<strong>没有安装,本主页提供站点不支持这个组件</strong>"
?牐燛lse
?牐燫esponse.Write "安装了,本主页提供站点支持使用这个组件!"
?牐燛nd If
?牐燫esponse.Write "</TD></TR>" & vbCrLf
?牐燦ext
?牐?%>
?牐?</TABLE>
?牐?<%
?牐燛nd If
?牐?%>
?牐?</BODY>
?牐?</HTML>
?牐犖姨峁┱飧龉ぞ呤窍M蠹野炎约旱闹饕吃桨煸胶茫芄怀浞掷媚愕母鋈酥饕痴镜闾峁┑淖榧龀黾际跛礁叩腁SP主页。