To register a DLL's VBScript CLASS inside an ASP page

Source: Internet
Author: User
Tags vbscript class
VBScript-----------------------------------------------ROOT1---------------------------------------

*******************************************************************************************
* Use this class to manage and register your DLL in an ASP page
* This class is tested on win 2 K through
* Note: Use this class to create an XML file first. The documents are as follows. Open Notepad to save the following 3 lines as *. XML file
*
* <?xml version= "1.0" encoding= "gb2312" standalone= "yes"?>
* <dll list >
* </dll list >
*
*------------------------------------------------------------------------------------------
Example
* Dim ObjRegsvr32
* Set ObjRegsvr32 = new Regsvr32
* with ObjRegsvr32
* If. Loadxml (".. /mydll.xml ") Then
* Call Response.Write ("XML file load Error")
* Set ObjRegsvr32 = Nothing
* Response.End
* End If
* Select Case. AddNode ("F:\web\cw31072\dll\test\MyClass.dll", True) ' Add new entry and register DLL
* Case 1
* Call Response.Write ("entry has been added to XML file!") and successfully registered DLL! ")
* Case 0
* Call Response.Write ("entry has been added to XML file!") But failed to register DLL! ")
* Case-1
* Call Response.Write ("The entry is already in the XML file!") The DLL has also been registered! ")
* End Select
*        ..........................
* End With
*
* ' This class is very simple, there are some methods, I do not give an example, see To know. You can open it later.
* ' The XML file looks at the list of DLLs that you have registered and that you want to register.
* ' XML file for each entry as follows: <dll has been registered = "1" >F:\web\cw31072\dll\test\MyClass.dll</Dll>
* ' F:\web\cw31072\dll\test\MyClass.dll is your path to the DLL file
* "has been registered =" 1 "is that the DLL has been registered, =" 0 "is not registered yet!
*******************************************************************************************

Class Regsvr32

Private S_objxml
Private S_objnoderoot
Private S_strxmlpath
Private S_strattributename

'------------------------------------
' Purpose: Load DLL configuration XML file
' Parameter: XML file address
' Return: Return true on load failure
'------------------------------------
Public Function Loadxml (strpath)
Set S_objxml = CreateObject ("MSXML2. DOMDocument ")
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 = "is registered"
End Function

'---------------------------------------------
' Purpose: To add a DLL project
' Parameter: Strpath:dll file address
' Blnreg: Whether to register it after adding
' Return: If required to add after registration, registration success will return 1, registration failure to return 0, already have the item and note the book return-1
'---------------------------------------------
Public Function Addn



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.