Registered members, create your web development database, ---------------------------------------- ------- ROOT1 -------------------------------------------------------------------------------------------
************************************************* ****************************************
*Use this class to manage and register your DLL in the ASP page
*This class is tested on Win 2K
*Note: Use this class to create a XML file first. The file is as follows. Open the notepad will store the following 3 lines as*.xml file
*
*<? Xml Version = "1.0" ENCODING = "GB2312" Standalone = "YES"?>
*<DLL List>
*</dll list>
*
*------------------------------------------------- -----------------------------------------------------------------------------------------------------------------------------------------------------------
*example:
*Dim objretsvr32
*Set objregsvr32 = new regsvr32
*With objregsvr32
*if .loadxml ("../ mydll.xml") then
*call response.write ("XML file loading error")
*set objregsvr32 = Nothing
*response.end
*end if
*select case .addnode ("f: /Web/cw31072/dll/test/myClass.dll", true) ‘add new entries and register DLL
*Case 1
*Call Response.write ("The entry has been added to the XML file! And successfully registered DLL!")
*Case 0
*Call Response.write ("The entry has been added to the XML file! But it failed when registered DLL!")
*case -1
*Call Response.write ("There is already this entry in the xml file! The DLL has also been registered!")
*End Select
*..........................
*end with
*
*'Ben Class is very simple, there are some ways in it, so I wo n’t give an example, just look at it. You can open it in the future
*'The XML file depends on the DLL list you have registered and to be registered.
*'XML files in each entry are as follows: <dl has registered = "1"> f: /Web/cw31072/dll/test/myclass.dll </dll>
*'f: /web/cw31072/dll/test/myclass.dll is the path of your dll file
*'Whether it has been registered = "1" is that the DLL has been registered, = "0" is not yet registered!
************************************************* ****************************************
class regsvr32
Private s_objxml
Private s_objnoderoot
Private s_strxmlpath
Private s_strattributename
'--------------------------------------------------------------------------------------------------------------------------------
'Objective: Load DLL configuration XML file
'Parameter: XML file address
'Return: Return to TRUE if it fails to load
'--------------------------------------------------------------------------------------------------------------------------------
Public function loadxml (strpath)
set s_Objxml = CreateObject ("msxml2.Document")
s_objxml.async = false
s_objxml.load (strpath)
if s_objxml.parseerror.errorCode <> 0 THEN
set s_objxml = nothing
loadxml = true
exit function
end if
set s_objnoderoot = s_Objxml.documentelement
s_strxmlpath = strpath
s_strattributename = "Whether it has been registered"
end function
'-------------------------------------------
'Objective: Add a DLL project
'Parameters: Strpath: DLL file address
'blnreg: Whether to register it after adding
'Return: If the registration is required, the registration is successful, the registration fails, the registration failure returns 0, the project already has the project and the register will return -1
'-------------------------------------------
Public function adDN