仓酷云

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 1785|回复: 18
打印 上一主题 下一主题

[学习教程] ASP网站制作之检测ISP是不是撑持ASP组件的代码

[复制链接]
再见西城 该用户已被删除
跳转到指定楼层
楼主
发表于 2015-2-3 23:37:38 | 显示全部楼层 回帖奖励 |倒序浏览 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
使用filesystemobject,可以对服务器上的文件进行操作,浏览、复制、移动、删除等。有ado的支持,asp对数据库的操作非常得心应手。你甚至可以像使用本地数据库那样,管理远程主机上的数据库,对表格、记录进行各种操作。   <%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> </p>  由于ASP还是一种Script语言所没除了大量使用组件外,没有办法提高其工作效率。它必须面对即时编绎的时间考验,同时我们还不知其背后的组件会是一个什么样的状况;
再见西城 该用户已被删除
沙发
 楼主| 发表于 2015-3-14 22:17:53 | 显示全部楼层
在平时的学习过程中要注意现学现用,注重运用,在掌握了一定的基础知识后,我们可以尝试做一些网页,也许在开始的时候我们可能会遇到很多问题,比如说如何很好的构建基本框架。
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|仓酷云 鄂ICP备14007578号-2

GMT+8, 2024-5-21 22:16

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表