
24/04/2005, 15:45
|
 | | | Fecha de Ingreso: mayo-2004 Ubicación: The Matrix
Mensajes: 223
Antigüedad: 20 años, 11 meses Puntos: 0 | |
Objetos que están instalados en el servidor... test.asp <% @ Language="VBScript" %>
<% Option Explicit %>
<%
Dim ObjInstalados(13)
ObjInstalados(1) = "JMail.SMTPMail"
ObjInstalados(2) = "CDONTS.NewMail"
ObjInstalados(3) = "aspSmartMail.SmartMail"
ObjInstalados(4) = "Persits.MailSender"
ObjInstalados(5) = "CDO.Message"
'Luego podemos ir agregando mas objetos, segun los que necesitemos
Function IsObjInstalled(strClassString)
On Error Resume Next
' initialize default values
IsObjInstalled = False
Err = 0
' testing code
Dim xTestObj
Set xTestObj = Server.CreateObject(strClassString)
If 0 = Err Then IsObjInstalled = True
' cleanup
Set xTestObj = Nothing
Err = 0
End Function
%>
<HTML>
<HEAD>
<TITLE>Test de objetos instalados</TITLE>
</HEAD>
<BODY>
<TABLE BORDER=0>
<%
Dim i
For i=0 to UBound(ObjInstalados)
Response.Write "<TR><TD>" & ObjInstalados(i) & "</TD><TD>"
If Not IsObjInstalled(ObjInstalados(i)) Then
Response.Write "<strong>no instalado</strong>"
Else
Response.Write "instalado"
End If
Response.Write "</TD></TR>" & vbCrLf
Next
%>
</TABLE>
__________________ HPNeo
Última edición por HPNeo; 25/04/2005 a las 15:05 |