Tips for calling DCOM components in ASP (1)

Source: Internet
Author: User

1. Compile the DCOM component:
Suppose we want to remotely start the DNS service through the ASP page, and the DNS server is different from the Web server. We can compile an ActiveX DLL to implement this function.
First, create a batch file StartDNS. bat, which is written to the file: Net Start DNS. Save the file to a directory on the DNS server, for example, C: \ ManDNS \:
Next, we compile the Dll program as follows ):
Public Function StartDNS () As Boolean
On Error GoTo ErrHandle
Dim strReturn = Shell ("C: \ ManDNS \ StartDNS. bat ")
StartDNS = True
Exit Function ErrHandle: StartDNS = False
End Function
DLL name: ManDNS Class Name: DNSClass we save this DLL under C: \ ManDNS.
2. register the DCOM component:
After compiling the DLL program, we need to register it on the server.

First, open Microsoft Transaction Server on the DNS Server, click Computers, then click My Computer, select Packages Installed, right-click, select New, and click Package. The Package Wizard is displayed. Select the empty package and name it "ManDNS". OK. Open this package, select Component, right-click, and select New ---> Component. Click Import Component That Are Already and select ManDNS. Dll from the list box.
Then open Microsoft Transaction Server on the Web Server, click Computers, click Remote Computer, select the ManDNS Component on the DNS Server, and click OK to add it to the Web Server.


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.