檢測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
    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>



相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.