'函数名:IsObjInstalled
'作 用:测试组件是否安装
'参 数:strClassString ---- 组件名称或标识字串
'返回值:测试成功返回 True 否则 False
'示 例:IsObjInstalled("JMAIL.Message")
'**************************************************
Public Function IsObjInstalled(ByVal 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
'**************************************************
'函数名:GetObjVer
'作 用:返回组件版本信息
'参 数:strClassString ---- 组件名称或标识字串
'返回值:返回组件版本信息字串
'示 例:GetObjVer("JMAIL.Message")
'**************************************************
Public Function GetObjVer(ByVal strClassString)
On Error Resume Next
GetObjVer=""
Err = 0
Dim xTestObj
Set xTestObj = Server.CreateObject(strClassString)
If 0 = Err Then GetObjVer=xtestobj.version
Set xTestObj = Nothing
Err = 0
End Function
'**************************************************
'函数名:ListObjInfo
'作 用:列出组件安装信息
'参 数: ----
'返回值:列出组件安装信息
'示 例:ListObjInfo()
'**************************************************
Public Function ListObjInfo()
Dim TempBs,TempBsXX,TempObjType,tmpObjs
TempBs="×"
TempBsXX=""
TempObjType=""
tmpObjs=""
tmpObjs=tmpObjs& "JMail.Message|"
tmpObjs=tmpObjs& "ADODB.Stream|"
tmpObjs=tmpObjs& "MSWC.AdRotator|"
tmpObjs=tmpObjs& "MSWC.BrowserType|"
tmpObjs=tmpObjs& "MSWC.NextLink|"
tmpObjs=tmpObjs& "MSWC.Tools|"
tmpObjs=tmpObjs& "MSWC.Status|"
tmpObjs=tmpObjs& "MSWC.Counters|"
tmpObjs=tmpObjs& "MSWC.PermissionChecker|"
tmpObjs=tmpObjs& "Scripting.FileSystemObject|"
tmpObjs=tmpObjs& "adodb.connection|"
tmpObjs=tmpObjs& "SoftArtisans.FileUp|"
tmpObjs=tmpObjs& "SoftArtisans.FileManager|"
tmpObjs=tmpObjs& "CDONTS.NewMail|"
tmpObjs=tmpObjs& "Persits.MailSender|"
tmpObjs=tmpObjs& "LyfUpload.UploadFile|"
tmpObjs=tmpObjs& "Persits.Upload.1|"
tmpObjs=tmpObjs& "w3.upload|"
tmpObjs=Split(tmpObjs,"|")
Response.write "
组件标识√|×版本" & vbCrlf
For i = LBound(tmpObjs) To UBound(tmpObjs)
If Trim(tmpObjs(i))"" Then
If IsObjInstalled(tmpObjs(i)) Then
TempObjType=tmpObjs(i)
TempBs="√"
TempBsXX=GetObjVer(tmpObjs(i))
If TempBsXX="" Then TempBsXX=" "
Else
TempObjType=""&tmpObjs(i)&""
TempBs="×"
TempBsXX=" "
End If
Response.write "" & vbCrlf
Response.write ""&TempObjType&"" & vbCrlf
Response.write ""&TempBs&"" & vbCrlf
Response.write ""&TempBsXX&"" & vbCrlf
Response.write "" & vbCrlf
End If
Next
Response.write "
" & vbCrlf
End Function

