检测已经安装的服务器组件

时间:2008-12-13 00:10:08  来源:第二电脑网上收集  作者:第二电脑网

  第二电脑网导读: />theComponent(0) = "ADODB.Connection"theComponent(1) = "SoftArtisans.FileUp"theComponent(2) = "AspHTTP.Conn"theComponent(3) = "AspImage.Image"theComponent(4) = "LastMod.FileObj"theComponent(5) = "Scripting.FileSystemObject"theComponent(6) = "SMTPsvg.Mailer&...
  正文:此功能来自一个DWMX插件,剥离代码后可以根据需要进行扩展.
<% '定义检测内容数组
Dim theComponent(11)
Dim theComponentName(11)
theComponent(0) = "ADODB.Connection"
theComponent(1) = "SoftArtisans.FileUp"
theComponent(2) = "ASP/ target=_blank class=infotextkey>aspHTTP.Conn"
theComponent(3) = "AspImage.Image"
theComponent(4) = "LastMod.FileObj"
theComponent(5) = "Scripting.FileSystemObject"
theComponent(6) = "SMTphotoshop/ target=_blank class=infotextkey>psvg.Mailer"
theComponent(7) = "CDONTS.NewMail"
theComponent(8) = "Jmail.smtpmail"
theComponent(9) = "SmtpMail.SmtpMail.1"
theComponent(10) = "Persits.Upload.1"
theComponent(11) = "UnitedBinary.AutoImageSize"
theComponentName(0) = "ADODB"
theComponentName(1) = "SA-FileUp"
theComponentName(2) = "AspHTTP"
theComponentName(3) = "AspImage"
theComponentName(4) = "LastMod"
theComponentName(5) = "FileSystemObject"
theComponentName(6) = "ASPMail"
theComponentName(7) = "CDONTS"
theComponentName(8) = "JMail"
theComponentName(9) = "SMTP"
theComponentName(10) = "Persits Upload"
theComponentName(11) = "AutoImageSize"
Function IsObjInstalled(strClassString)
On Error Resume Next
IsObjInstalled = False
Err = 0
Dim xTestObjSet
 xTestObj = Server.CreateObject(strClassString)
If 0 = Err Then
IsObjInstalled = True
Set xTestObj = Nothing
Err = 0
End
Function%>   
<% '
以表格形式循环输出检测内容Dim i
 
For i=0 to UBound(theComponent)
 If
Not IsObjInstalled(theComponent(i)) Then
 
Else     Response.Write "<table><tr>" & vbCrLf 
  Response
.Write "<td width=""100%"">" & vbCrLf  
 Response
.Write "<b>" & theComponentName(i) & "</b>" & vbCrLf  
 Response
.Write "</td>" & vbCrLf 
 Response
.Write "</tr></table>" & vbCrLf    
 End
If    
 
Next       %>


使用方法:

1.将以上代码直接引入需要页面即可


"检测已经安装的服务器组件"由第二电脑网原创提供,转载请注明:http://www.002pc.com/master/College/Programming/ASP/2008-10-07/2933.html


关键字:

关于《检测已经安装的服务器组件》文章的评论

站内搜索: 高级搜索

热门搜索: Windows style 系统 tr IP QQ CPU 安装 function 注册 if td