/ Forside / Teknologi / Udvikling / ASP / Nyhedsindlæg
Login
Glemt dit kodeord?
Brugernavn

Kodeord


Reklame
Top 10 brugere
ASP
#NavnPoint
smorch 9259
Harlekin 1866
molokyle 1040
Steffanst.. 758
gandalf 657
smilly 564
gibson 560
cumano 530
MouseKeep.. 480
10  Random 410
Liste over installerede komponenter
Fra : Rasmus Nielsen


Dato : 03-02-01 21:26

Hej,

Er det muligt at fremkalde subj. via ASP?

Venlig hilsen, Rasmus nielsen.



 
 
Thygesen (05-02-2001)
Kommentar
Fra : Thygesen


Dato : 05-02-01 18:19

> Er det muligt at fremkalde subj. via ASP?

Nej, ikke umiddelbart, kun hvis webhotellet har gjordt det muligt.

Mvh. Christoffer



Karsten Damgaard (05-02-2001)
Kommentar
Fra : Karsten Damgaard


Dato : 05-02-01 20:59

> Er det muligt at fremkalde subj. via ASP?

Nedenstående stykke kode vil prøve på at skabe objekterne(find selv på
flere) fra et Array.
Hvis de eksisterer får du 'installed!', ellers får du 'not installed'.
Jeg har desuden lagt et eksempel op på http://www.hangaround.dk/testobj.asp.

Mvh Karsten


<% @ 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(33)

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"
theInstalledObjects(9) = "SOFTWING.AspTear"
theInstalledObjects(10) = "Persits.Upload.1"
theInstalledObjects(11) = "SMTPsvg.Mailer"
theInstalledObjects(12) = "POP3svg.Mailer"
theInstalledObjects(13) = "AspNNTP.Conn"
theInstalledObjects(14) = "AspHTTP.Conn"
theInstalledObjects(15) = "AspDNS.Lookup"
theInstalledObjects(16) = "AspImage.Image"
theInstalledObjects(17) = "JMail.Message"
theInstalledObjects(18) = "Socket.TCP"
theInstalledObjects(19) = "ImgSize.Check"
theInstalledObjects(20) = "AspPing.Conn"
theInstalledObjects(21) = "LastMod.FileObj"
theInstalledObjects(22) = "WaitFor.Comp"
theInstalledObjects(23) = "AspCrypt.Crypt"
theInstalledObjects(24) = "GuidMakr.GUID"
theInstalledObjects(25) = "ASPExec.Execute"
theInstalledObjects(26) = "AspInet.FTP"
theInstalledObjects(27) = "ASPsvg.Process"
theInstalledObjects(28) = "Bible.Lookup"
theInstalledObjects(29) = "AspMX.Lookup"
theInstalledObjects(30) = "AspFile.FileObj"
theInstalledObjects(31) = "AspConv.Expert"
theInstalledObjects(32) = "AspSock.Conn"
theInstalledObjects(33) = "AspQMail.Mailer"

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>
<META name="robots" content="noindex, nofollow">
<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
%>

</BODY>
</HTML>







Karsten Damgaard (06-02-2001)
Kommentar
Fra : Karsten Damgaard


Dato : 06-02-01 08:15

> Er det muligt at fremkalde subj. via ASP?

Nedenstående stykke kode vil prøve på at skabe objekterne(find selv på
flere) fra et Array.
Hvis de eksisterer får du 'installed!', ellers får du 'not installed'.
Jeg har desuden lagt et eksempel op på http://www.hangaround.dk/testobj.asp.

Mvh Karsten


<% @ 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(33)

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"
theInstalledObjects(9) = "SOFTWING.AspTear"
theInstalledObjects(10) = "Persits.Upload.1"
theInstalledObjects(11) = "SMTPsvg.Mailer"
theInstalledObjects(12) = "POP3svg.Mailer"
theInstalledObjects(13) = "AspNNTP.Conn"
theInstalledObjects(14) = "AspHTTP.Conn"
theInstalledObjects(15) = "AspDNS.Lookup"
theInstalledObjects(16) = "AspImage.Image"
theInstalledObjects(17) = "JMail.Message"
theInstalledObjects(18) = "Socket.TCP"
theInstalledObjects(19) = "ImgSize.Check"
theInstalledObjects(20) = "AspPing.Conn"
theInstalledObjects(21) = "LastMod.FileObj"
theInstalledObjects(22) = "WaitFor.Comp"
theInstalledObjects(23) = "AspCrypt.Crypt"
theInstalledObjects(24) = "GuidMakr.GUID"
theInstalledObjects(25) = "ASPExec.Execute"
theInstalledObjects(26) = "AspInet.FTP"
theInstalledObjects(27) = "ASPsvg.Process"
theInstalledObjects(28) = "Bible.Lookup"
theInstalledObjects(29) = "AspMX.Lookup"
theInstalledObjects(30) = "AspFile.FileObj"
theInstalledObjects(31) = "AspConv.Expert"
theInstalledObjects(32) = "AspSock.Conn"
theInstalledObjects(33) = "AspQMail.Mailer"

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>
<META name="robots" content="noindex, nofollow">
<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
%>

</BODY>
</HTML>



Søg
Reklame
Statistik
Spørgsmål : 177557
Tips : 31968
Nyheder : 719565
Indlæg : 6408868
Brugere : 218888

Månedens bedste
Årets bedste
Sidste års bedste