SoFunction
Updated on 2025-04-14

ASP essence source code collection (five-year summary) page 6/20


Methods to remotely register DLL using ASP
--------------------------
<% = True %>
<% = 500
Dim frmFolderPath, frmFilePath
frmFolderPath = ("frmFolderPath")
frmFilePath = ("frmDllPath")
frmMethod = ("frmMethod")
btnREG = ("btnREG")
%>
<HTML>
<HEAD>
<TITLE></TITLE>
<STYLE TYPE="TEXT/CSS">
.Legend {FONT-FAMILY: veranda; FONT-SIZE: 14px; FONT-WEIGHT: bold; COLOR: blue}
.FS {FONT-FAMILY: veranda; FONT-SIZE: 12px; BORDER-WIDTH: 4px; BORDER-COLOR: green;
MARGIN-LEFT:2px; MARGIN-RIGHT:2px}
TD {MARGIN-LEFT:6px; MARGIN-RIGHT:6px; PADDING-LEFT:12px; PADDING-RIGHT:12px}
</STYLE>
</HEAD>
<BODY>
<FORM NAME="regForm" METHOD="POST">
<TABLE BORDER=0 CELLSPACING=6 CELLPADDING=6 MARGINWIDTH=6>
<TR>
<TD VALIGN=TOP>
<FIELDSET ID=FS1 NAME=FS1 CLASS=FS>
<LEGEND CLASS=Legend>Regsvr Functions</LEGEND>
Insert Path to DLL Directory<BR>
<INPUT TYPE=TEXT NAME="frmFolderPath" VALUE="<%=frmFolderPath%>"><BR>
<INPUT TYPE=SUBMIT NAME=btnFileList VALUE="Build File List"><BR>
<%
IF ("btnFileList") <> "" OR btnREG <> "" Then
Set RegisterFiles = New clsRegister
("<B>Select File</B>")
Call (frmFolderPath)
("<BR><INPUT TYPE=SUBMIT NAME=btnREG VALUE=" & Chr(34) _
& "REG/UNREG" & Chr(34) & ">")
IF ("btnREG") <> "" Then
Call (frmFilePath, frmMethod)
End IF
Set RegisterFiles = Nothing
End IF
%>
</FIELDSET>
</TD>
</TR>
</TABLE>
</FORM>
</BODY>
</HTML>
<%
Class clsRegister
Private m_oFS
Public Property Let oFS(objOFS)
m_oFS = objOFS
End Property
Public Property Get oFS()
Set oFS = ("")
End Property
Sub init(strRoot) 'Root to Search (c:, d:, e:)
Dim oDrive, oRootDir
IF (strRoot) Then
IF Len(strRoot) < 3 Then 'Must Be a Drive
Set oDrive = (strRoot)
Set oRootDir =
Else
Set oRootDir = (strRoot)
End IF
Else
EchoB("<B>Folder ( " & strRoot & " ) Not Found.")
Exit Sub
End IF
setRoot = oRootDir
Echo("<SELECT NAME=" & Chr(34) & "frmDllPath" & Chr(34) & ">")
Call getAllDlls(oRootDir)
EchoB("</SELECT>")
BuildOptions
End Sub
Sub getAllDlls(oParentFolder)
Dim oSubFolders, oFile, oFiles
Set oSubFolders =
Set opFiles =
For Each oFile in opFiles
IF Right(lCase(), 4) = ".dll" OR Right(lCase(), 4) = ".ocx" Then
Echo("<OPTION VALUE=" & Chr(34) & & Chr(34) & ">" _
& & "</Option>")
End IF
Next
On Error Resume Next
For Each oFolder In oSubFolders 'Iterate All Folders in Drive
Set oFiles =
For Each oFile in oFiles
IF Right(lCase(), 4) = ".dll" OR Right(lCase(), 4) = ".ocx" Then
Echo("<OPTION VALUE=" & Chr(34) & & Chr(34) & ">" _
& & "</Option>")
End IF
Next
Call getAllDlls(oFolder)
Next
On Error GoTo 0
End Sub
Sub Register(strFilePath, regMethod)
Dim theFile, strFile, oShell, exitcode
Set theFile = (strFilePath)
strFile =
Set oShell = CreateObject ("")
IF regMethod = "REG" Then 'Register
"c:\WINNT\system32\ /s " & strFile, 0, False
exitcode = ("c:\WINNT\system32\ /s " & strFile, 0, False)
EchoB(" exitcode = " & exitcode)
Else 'unRegister
"c:\WINNT\system32\ /u/s " & strFile, 0, False
exitcode = ("c:\WINNT\system32\ /u/s " & strFile, 0, False)
EchoB(" exitcode = " & exitcode)
End IF
Cleanup oShell
End Sub
Sub BuildOptions
EchoB("Register: <INPUT TYPE=RADIO NAME=frmMethod VALUE=REG CHECKED>")
EchoB("unRegister: <INPUT TYPE=RADIO NAME=frmMethod VALUE=UNREG>")
End Sub
Function Echo(str)
Echo = (str & vbCrLf)
End Function
Function EchoB(str)
EchoB = (str & "<BR>" & vbCrLf)
End Function
Sub Cleanup(obj)
If isObject(obj) Then
Set obj = Nothing
End IF
End Sub
Sub Class_Terminate()
Cleanup oFS
End Sub
End Class
%>
List all your session changes:
<%@ Language=VBScript %>
<% Option Explicit %>
<%
"In your program, use a total of " & & _
"Session variable<P>"
Dim strName, iLoop
For Each strName in
'Determine whether a Session variable is an array
If IsArray(Session(strName)) then
'If it is an array, then list all the array elements contents
For iLoop = LBound(Session(strName)) to UBound(Session(strName))
strName & "(" & iLoop & ") - " & _
Session(strName)(iLoop) & "<BR>"
Next
Else
'If it is not an array, then display it directly
strName & " - " & (strName) & "<BR>"
End If
Next
%>
Previous page1234567891011121314151617181920Next pageRead the full text