服务器讯息CheckObjInstalled函数 - TOMMYHU - 专注互联网开发及运营技术,提供相关资料及软件下载,奇趣网络时事评论!
Mar 9

服务器讯息CheckObjInstalled函数 不指定

tommyhu , 13:44 , ASP , Comments(0) , Trackbacks(0) , Reads(8201) , Via Original Large | Medium | Small
服务器讯息CheckObjInstalled函数
缺少关键组件的Server,将会使asp运作大受影响,但要如何知道Server支持那些组件呢??
可以使用底下CheckObjInstalled这个函数,它提供很大的便利性

  程序代码


<%

Function  CheckObjInstalled(strClassString)

        On  Error  Resume  Next

        Dim  Temp

        Err  =  0

        Dim  TmpObj

        Set  TmpObj  =  Server.CreateObject(strClassString)

        Temp  =  Err

        IF  Temp  =  0  or  Temp  =  -2147221477  Then

                CheckObjInstalled=  "<font  color=""#FF0000""><b>√</b></font>"

        ElseIF  Temp  =  1  or  Temp  =  -2147221005  Then

                CheckObjInstalled="<font  color=""#FF0000""><b>×</b></font>"

        End  IF

        Err.Clear

        Set  TmpObj  =  Nothing

        Err  =  0

End  Function

str=CheckObjInstalled("JMail.Message")

response.write "支援Jmail否??"&str&"<br>"

str=CheckObjInstalled("Persits.MailSender")

response.write "支援AspMail否??"&str&"<br>"

str=CheckObjInstalled("CDONTS.NewMail")

response.write "支援cdonts否??"&str&"<br>"

str=CheckObjInstalled("Persits.Upload")

response.write "支援AspUpload否??"&str&"<br>"

str=CheckObjInstalled("Scripting.FileSystemObject")

response.write "支援Scripting.FileSystemObject否??"&str&"<br>"

str=CheckObjInstalled("MSXML2.ServerXMLHTTP")

response.write "支援MSXML2.ServerXMLHTTP否??"&str&"<br>"

str=CheckObjInstalled("Microsoft.XMLDOM")

response.write "支援Microsoft.XMLDOM否??"&str&"<br>"

str=CheckObjInstalled("ADODB.Stream")

response.write "支援ADODB.Stream否??"&str&"<br>"

str=CheckObjInstalled("Scripting.Dictionary")

response.write "支援Scripting.Dictionary否??"&str&"<br>"

%>


▲返回顶部
Last modified by tommyhu on2009/03/09 14:22

Add a comment

Nickname

emotemotemotemotemotemotemotemotemotemotemotemotemotemotemotemot