打印本文 打印本文 关闭窗口 关闭窗口
[我的ASP.net学习历程]Reference
作者:武汉SEO闵涛  文章来源:敏韬网  点击数762  更新时间:2009/4/23 10:44:28  文章录入:mintao  责任编辑:mintao

<%@ Page Language="C#" %>
<script runat="server">

    void Page_Load()
    {
        int a = 1;
  Increment(ref a);  //当形参改变时,实参也会改变
        lblMessage.Text = a.ToString();
    }
   
    void Increment(ref int Number)
    {
        Number += 1;
    }

</script>
<html>
<head>
    <title>Chapter 5 - Demonstration of Passing a Parameter by Reference</title>
</head>
<body>
    <asp:Label id="lblMessage" runat="server"></asp:Label>
</body>
</html>

打印本文 打印本文 关闭窗口 关闭窗口