Code that detects whether an ISP supports ASP components

Source: Internet
Author: User
<%option explicit%>
<%
' This is some of the components that came with IIS4 (default)
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> tools to detect whether your ISP supports ASP components </TITLE>
</HEAD>
<BODY>
Enter the ProgID or ClassID of the component you want to test in the following input box.
If you do not enter, the default value will be used.
<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> This homepage provides a site that does not support this component </strong>"
Else
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.