To determine whether an asp Component is installed on the server, the commonly used code is as follows:
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
%>