Determine whether the dll file has registered ASP Function Code

Source: Internet
Author: User

Asp checks whether a component is installed on the server, that is, whether a dll file is installed, and whether a component is registered on the server. There are many asp components, which can reduce many asp errors, the following functions are used: Copy codeThe Code is as follows: <%
'Function: Check whether system components or components are successfully installed.
'Parameter: component name
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
'Get the version number of the system component
Function getver (Classstr)
On Error Resume Next
Getver = ""
Err = 0
Dim xTestObj
Set xTestObj = Server. CreateObject (Classstr)
If 0 = Err Then getver = xtestobj. version
Set xTestObj = Nothing
Err = 0
End Function
%>

The call method is as follows:Copy codeThe Code is as follows: <%
If IsObjInstalled ("fso. file") = True then
Response. write ("installed") & getver ("fso. file ")
End if
%>

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.