WebForm1.aspx.cs

(开头部分) 10KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
namespace Calculator
{
    public partial class WebForm1 : System.Web.UI.Page
    {
       static  double numOne = 0, numTwo = 0,ans, temp;

        static char opr = ' ';
        static int step = 0, op = 0, tempp = 0;
        //记录操作运算符
        // 下载于www.51aspx.com
        /*
         * step用于标记是否刚按了运算符,为0时,没有按,按了运算符,置1,则再按数字时清空显示框,置0
         *       这样,输入123,按了+号,再来按数字时,比如按1,则先情况显示框,再显示1,之后再按数字键,又像之前一样在后面增加
         * op是记录是否刚刚按了运算符,按了则赋值1,然后再按数字,则会(清屏,op置0),之后再按数字,不会清屏了
         * tempp是MS,MR等4个按键时需要的变量,当MS保存了数据后,tempp为1,tempp为0是没保存数据
         */ 
        //在显示框内增加字符
        private void AppendChar(char c)
        {
            Input.Text += new string(c, 1);
        }
        //在显示框数据的前面加一个字符
        private void InsertChar(char c)
        {
            Input.Text = new string(c, 1) + Input.Text;
        }
        //删除最后输入的一个数据,即显示框中的最后一个字符
        private void RemoveLastChar()
        {
            if (Input.Text.Length > 0)
                Input.Text = Input.Text.Substring(0, Input.Text.Length - 1);
        }
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        //MS为保存,即保存当前显示框内的数据,此时计算器上显示一个"M",表明已经保存了数据
        protected void ButtonMS_Click(object sender, EventArgs e)
        {
          
            temp = Convert.ToDouble(Input.Text.ToString());
            tempp = 1;
            Input.Text = "M";

        }
        // //清空显示框中的内容,用于输入数据错误,要重新输入时使用
        protected void ButtonCE_Click(object sender, EventArgs e)
        {
            Input.Text = string.Empty;
        }
        protected void ButtonC_Click(object sender, EventArgs e)
        { 
            Input.Text = String.Empty;
后面还有 280 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。