繁体中文
设为首页
加入收藏
当前位置:ASP技术首页 >> 组件开发 >> 检测ISP是否支持ASP组件的代码

检测ISP是否支持ASP组件的代码

2004-10-01 08:26:10  作者:  来源:互联网  浏览次数:50  文字大小:【】【】【
简介:<%Option Explicit%>   <%   ' 这是一些随IIS4附带的一些组件(默认的)   Dim theInstalledObjects(8)   theInstalledObjects(0) = "MSWC.AdRotator"   theInstalledObjects...

<%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

  %>

  

  

  检测ISP是否支持ASP组件的工具

  

  

  在下面的输入框中输入你要检测的组件的ProgId或则ClassId.

  如果你没有输入的话,将使用默认值。

  

method=post>

  

  

  

  

  <%

  Dim strClass

  strClass = Trim(Request.Form("classname"))

  If "" <> strClass then

   Response.Write strClass & " "

   If Not IsObjInstalled(strClass) then

    Response.Write "本主页提供站点不支持这个组件"

   Else

    Response.Write "安装了,本主页提供站点支持使用这个组件!"

   End If

   Response.Write "

" & vbCrLf

  Else

  %>

  

  <%

  Dim i

  For i=0 to UBound(theInstalledObjects)

   Response.Write "

" & vbCrLf

  Next

  %>

  

" & theInstalledObjects(i) & ""

   If Not IsObjInstalled(theInstalledObjects(i)) Then

    Response.Write "本主页提供站点不支持这个组件"

   Else

    Response.Write "安装了,本主页提供站点支持使用这个组件!"

   End If

   Response.Write "

  <%

  End If

  %>

  

  

责任编辑:admin
相关文章