Sometimes it is necessary to determine whether the server follows the dll file, then you can refer to the following code to determine. ASP determines whether a certain component is installed on the server, that is, whether a certain dll file is installed, and whether a certain component is registered on the server. There are many ASP components, and its judgment can reduce many ASP errors. It mainly uses the following functions:
Copy the code code as follows:
<%
'Function: Check whether system components exist or whether the components are installed successfully
'Parameter: component name
Function IsObjInstalled(strClassString)
On Error Resume Next
IsObjInstalled = False
Err = 0
DimxTestObj
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
DimxTestObj
Set xTestObj = Server.CreateObject(Classstr)
If 0 = Err Then getver=xtestobj.version
Set xTestObj = Nothing
Err = 0
End Function
%>
The calling method is as follows:
Copy the code code as follows:
<%
if IsObjInstalled(fso.file) =True then
response.write(already installed)&getver(fso.file)
end if
%>