快精灵印艺坊 您身边的文印专家
广州名片 深圳名片 会员卡 贵宾卡 印刷 设计教程
产品展示 在线订购 会员中心 产品模板 设计指南 在线编辑
 首页 名片设计   CorelDRAW   Illustrator   AuotoCAD   Painter   其他软件   Photoshop   Fireworks   Flash  

 » 彩色名片
 » PVC卡
 » 彩色磁性卡
 » 彩页/画册
 » 个性印务
 » 彩色不干胶
 » 明信片
   » 明信片
   » 彩色书签
   » 门挂
 » 其他产品与服务
   » 创业锦囊
   » 办公用品
     » 信封、信纸
     » 便签纸、斜面纸砖
     » 无碳复印纸
   » 海报
   » 大篇幅印刷
     » KT板
     » 海报
     » 横幅

检测ISP是否支持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>
返回类别: 教程
上一教程: 文件的读出 编辑 治理
下一教程: 不刷新页面的情况下调用远程ASP

您可以阅读与"检测ISP是否支持ASP组件的代码"相关的教程:
· 利用ASP验证身份证号是否准确的代码
· ASP中ADODB STREAM组件的具体用法
· 将ASP代码移植为VB COM组件-2
· 在ASP中用组件检测当前网卡地址
· 用ASP实现的代码批量修改程序
    微笑服务 优质保证 索取样品