万卷书   首页 > 电脑书籍 > Asp > 在ASP中调用DCOM组件的应用技巧
 

3、调用DCOM组件:

   编写StartDNS.htm,并在其中调用注册好的DCOM组件,程序如下:

  〈 %@ LANGUAGE="VBSCRIPT"%>

  〈 Html>

  〈 head>

  〈 title>

  Start DNS Page

  〈 /title>

  〈 head>

  〈 body>

  〈 h1> 单击按纽启动DNS服务 〈 /h1>

  〈 %

  if Request.form(“click”) 〈> “” then

  dim StartDNS ,RenStart

  set StartDNS = Server.CreateObject(“StartDNS.DNSClass”)

  RenStart = StartDNS. StartDNS

  If RenStart then

  Response.Write “DNS服务启动成功。”

  Else

  Response.Write “DNS服务启动失败。”

  End if

  end if

  %>

  〈 Form action = “StartDNS.htm” method = “Post”>

  〈 Input type = submit name = submit value = “Start DNS”>

  〈 Input type = hidden name = click value = “click”>

  〈 /Form>

  〈 /Body>

  〈 /HTML>

   对于程序员来说,可以利用自己熟悉的编程工具来编写ActiveX Dll,用MTS进行管理,并用ASP程序将各种组件合理的搭建成系统,可以在Internet上实现几乎无所不能的功能。


上一页