Foros del Web » Programando para Internet » ASP Clásico »

Componentes

Estas en el tema de Componentes en el foro de ASP Clásico en Foros del Web. Encontre este codigo para revisar que componentes tienen nuestros server instalados, por defecto busca los comunes y ademas da la opcion de buscar nuestros propios ...
  #1 (permalink)  
Antiguo 07/03/2003, 13:48
Avatar de deprabado  
Fecha de Ingreso: febrero-2002
Mensajes: 649
Antigüedad: 23 años, 2 meses
Puntos: 0
Componentes

Encontre este codigo para revisar que componentes tienen nuestros server instalados, por defecto busca los comunes y ademas da la opcion de buscar nuestros propios componentes.

<% @ Language="VBScript" %>
<% Option Explicit %>
<%
' there are a number of objects that come with IIS4
' these are put in the array that's declared below
Dim theInstalledObjects(8)

theInstalledObjects(0) = "MSWC.AdRotator"
theInstalledObjects(1) = "MSWC.BrowserType"
theInstalledObjects(2) = "MSWC.NextLink"
theInstalledObjects(3) = "MSWC.Tools"
theInstalledObjects(4) = "MSWC.Status"
theInstalledObjects(5) = "MSWC.Counters"
theInstalledObjects(6) = "IISSample.ContentRotator"
theInstalledObjects(7) = "IISSample.PageCounter"
theInstalledObjects(8) = "MSWC.PermissionChecker"

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 of installed objects</TITLE>
</HEAD>
<BODY>

Enter the ProgId or ClassId of the component you want to test in the textbox below. If you leave it empty, the default
components will be tested.

<FORM action=<%=Request.ServerVariables("SCRIPT_NAME")%> method=post>
<input type=text value="" name="classname" size=40>
<INPUT type=submit value=Submit>
<INPUT type=reset value=Reset>
</FORM>

<%
Dim strClass
strClass = Trim(Request.Form("classname"))
If "" <> strClass then
Response.Write strClass & " is "
If Not IsObjInstalled(strClass) then
Response.Write "<strong>not installed</strong>"
Else
Response.Write "installed!"
End If
Response.Write "<P>" & vbCrLf
Else
' default: list all components that should be installed
%>

<TABLE BORDER=0>
<%
Dim i
For i=0 to UBound(theInstalledObjects)
Response.Write "<TR><TD>" & theInstalledObjects(i) & "</TD><TD>"
If Not IsObjInstalled(theInstalledObjects(i)) Then
Response.Write "<strong>not installed</strong>"
Else
Response.Write "installed!"
End If
Response.Write "</TD></TR>" & vbCrLf
Next
%>
</TABLE>

<%
End If
%>
  #2 (permalink)  
Antiguo 07/03/2003, 17:04
Avatar de lubetpic  
Fecha de Ingreso: enero-2002
Ubicación: San Jose
Mensajes: 679
Antigüedad: 23 años, 3 meses
Puntos: 0
interesante

deberias de incluirlo en las faqs
  #3 (permalink)  
Antiguo 07/03/2003, 17:31
Avatar de deprabado  
Fecha de Ingreso: febrero-2002
Mensajes: 649
Antigüedad: 23 años, 2 meses
Puntos: 0
se pueden incluir muchos componentes mas a la lista, la cosa es saber como hacer referencia a los componentes, hasta ahora tengo esta lista si alguien quiere contribuir para hacerlo mas funcional sera bienvenido:

AspImage.Image
CDONTS.NewMail
SOFTWING.AspTear
AspHTTP.Conn
JMail.SMTPMail
aspZip.EasyZIP
aspSmartZip.SmartZip
aspSmartMail.SmartMail
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 21:04.