檢測ISP是否支援ASP組件的代碼
來源:互聯網
上載者:User
<%Option Explicit%>
<%
' 這是一些隨IIS4附帶的一些組件(預設的)
Dim theInstalledObjects(8)
theInstalledObjects(0) = "MSWC.AdRotator"
theInstalledObjects(1) = "MSWC.BrowserType"
theInstalledObjects(2) = "MSWC.NextLink"
theInstalledObjects(3) = "MSWC.Tools"
theInstalledObjects(4) = "MSWC.Status"
theInstalledObjects(5) = "MSWC.Counters"
theInstalledObjects(6) = "IISSample.ContentRotator"
theInstalledObjects(7) = "IISSample.PageCounter"
theInstalledObjects(8) = "MSWC.PermissionChecker"
Function IsObjInstalled(strClassString)
On Error Resume Next
IsObjInstalled = False
Err = 0
Dim xTestObj
Set xTestObj = Server.CreateObject(strClassString)
If 0 = Err Then IsObjInstalled = True
Set xTestObj = Nothing
Err = 0
End Function
%>
<HTML>
<HEAD>
<TITLE>檢測ISP是否支援ASP組件的工具</TITLE>
</HEAD>
<BODY>
在下面的輸入框中輸入你要檢測的組件的ProgId或則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>
<%
Dim strClass
strClass = Trim(Request.Form("classname"))
If "" <> strClass then
Response.Write strClass & " "
If Not IsObjInstalled(strClass) then
Response.Write "<strong>本首頁提供網站不支援這個組件</strong>"
Else