ASP编程 PHP编程 JSP编程 NET编程 CGI编程 XML编程 
Google adsense申请技巧本站核心代理域名注册主机业务 快速发布你的买卖域名买卖网站信息 1元注册 cn域名
站长每日新闻导读 √ ·推荐万网空间¥120元 150m 站长网:站长必上的网站网站联盟大全本站代理万网域名55空间120元
 2007-6-23 12:09:20

学习ASP中子程序的应用

来源: 字体:[ ]

在ASP中,你可通过VBScript和其他方式调用自程序。
实例:

调用使用VBScript的子程序
    如何从ASP调用以VBScript编写的子程序。
     <html>

    <head>
    <%
    sub vbproc(num1,num2)
    response.write(num1*num2)
    end sub
    %>
    </head>

    <body>
    <p>
    You can call a procedure like this:
    </p>
    <p>
    Result: <%call vbproc(3,4)%>
    </p>
    <p>
    Or, like this:
    </p>
    <p>
    Result: <%vbproc 3,4%>
    </p>
    </body>

    </html>
调用使用JavaScript的子程序
    如何从ASP调用以JavaScript编写的子程序。

    <%@ language="javascript" %>
    <html>
    <head>
    <%
    function jsproc(num1,num2)
    {
    Response.Write(num1*num2)
    }
    %>
    </head>
    <body>
    <p>
    Result: <%jsproc(3,4)%>
    </p>
    </body>
    </html>

调用使用VBScript和JavaScript的子程序
    如何在一个ASP文件中调用以VBScript和JavaScript编写的子程序。

    <html>
    <head>
    <%
    sub vbproc(num1,num2)
    Response.Write(num1*num2)
    end sub
    %>
    <script  language="javascript" runat="server">
    function jsproc(num1,num2)
    {
    Response.Write(num1*num2)
    }
    </script>
    </head>
    <body>
    <p>Result: <%call vbproc(3,4)%></p>
    <p>Result: <%call jsproc(3,4)%></p>
    </body>
    </html>

 

网站地图 - 域名注册续费虚拟主机代理 - 交易论坛 - 网站投稿 - 广告服务 - 帮助中心 - 联系我们
Copyright ©2003-2007 www.Admin5.com All Rights Reserved