ASP.Net/Language Basics/Int

Материал из .Net Framework эксперт
Перейти к: навигация, поиск

Int value calculation (C#)

<%@ Page Language="C#" %>
<script runat="server">
    void Page_Load()
    {
    
             int intNumber1;
             int intNumber2;
             int intNumber3;
             intNumber1 = 1;
             intNumber2 = 1;
             intNumber3 = intNumber1 + intNumber2;
             lblResult1.Text = Convert.ToString(intNumber3);
    
             int intNumber4;
             int intNumber5;
             int intNumber6;
             intNumber4 = 4;
             intNumber5 = 8;
             intNumber6 = intNumber4 + (intNumber5/6);
             lblResult2.Text = Convert.ToString(intNumber3);
    }   
</script>
<html>
    <head>
    </head>
    <body>
        <form runat="server">
        First example = <asp:Label runat="server" ID="lblResult1">Label</asp:Label><br>
        Second example = <asp:Label runat="server" ID="lblResult2">Label</asp:Label>
        </form>
    </body>
</html>