我的一亩三分地 我就喜欢!
13fen  设为主页
 收藏本站
 
当前位置: > 一亩三分地:首页 > 网络学院 > 网络编程 > ASP专区 > Asp组件/脚本 > 检测ISP是否支持ASP组件的代码
热门文章排行
热门文章排行 手推车”功能的实现(10-07)
八大法则防范ASP网站漏洞(10-23)
ASP教程十一、调试ASP脚本(10-23)
在JSP中访问数据库大全(10-23)
虚机服务中常见Asp.Net低级错误一览(03-21)
精采文章排行
精采文章排行 ASP.NET实现抓取网页中的链接(11-15)
ASP连接数据库的11种方法(11-10)
如何动态创建网页的RSS内容摘要(11-10)
ASP网站漏洞及入侵防范方法(11-10)
ASP自定义函数:对字符串正则替换(11-10)
技术专题推荐
网管论坛交流
 

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

作者:佚名   来源:一亩三分地   点击:   日期:2007-03-26

<%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
    Response.Write "安装了,本主页提供站点支持使用这个组件!"
   End If
   Response.Write "<P>" & vbCrLf
  Else
  %>
  <TABLE BORDER=0>
  <%
  Dim i
  For i=0 to UBound(theInstalledObjects)
   Response.Write "<TR><TD>" & theInstalledObjects(i) & "</TD><TD>"
   If Not IsObjInstalled(theInstalledObjects(i)) Then
    Response.Write "<strong>本主页提供站点不支持这个组件</strong>"
   Else
    Response.Write "安装了,本主页提供站点支持使用这个组件!"
   End If
   Response.Write "</TD></TR>" & vbCrLf
  Next
  %>
  </TABLE>
  <%
  End If
  %>
  </BODY>
  </HTML>

文章评论】 【收藏本文】 【推荐好友】 【打印本文】 【论坛讨论

   相关文章:
·ASP中巧用Response属性 ·第六课:ASP脚本循环语句
·在 Web 页上使用条件数值格式 ·连接数据库查询手册(不仅仅适用于asp)
·警惕"给你的FileSystemObject对象加把锁" ·用ASP做全文检索

   文章评论:(条)
  
 请留名: 匿名评论   点击查看所有评论 网管论坛
 

  责任编辑:一分  声明:刊登此文章是为了传递更多信息,文章内容仅供参考,转载请注明出处。