没有合适的资源?快使用搜索试试~ 我知道了~
首页用C#编写的 计算器程序 前台页面是用JS写的 源代码下载
用C#编写的 计算器程序 前台页面是用JS写的 源代码下载
2星 需积分: 9 10 下载量 91 浏览量
更新于2023-03-16
评论
收藏 30KB DOCX 举报
C#语言编写的计算器程序,功能类似于win7种的culator。包括基本的加减乘除模,和MS/MR/M+等。
资源详情
资源评论
资源推荐
C#编写的计算器程序
下面的源码是:.cs 文件中的内容
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;
public partial class _Default : System.Web.UI.Page
{
Boolean f;
double rlt;
public static double save;
//page load
protected void Page_Load(object sender, EventArgs e)
{
TextBox1.Focus();
if (TextBox4.Text.ToString() == "")
f = true;
else f = false;
}
//button1 click event
protected void Button1_Click(object sender, EventArgs e)
{
switch (f)//if the operation is empty the clicked num will input as
the second num
{
case true:
{
if (TextBox1.Text.ToString() != "")
TextBox1.Text = TextBox1.Text + "1";
else TextBox1.Text = "1";
};
break;
case false:
{
if (TextBox2.Text != "")
TextBox2.Text = TextBox2.Text + "1";
else TextBox2.Text = "1";
};
break;
}
}
//button2 click event
protected void Button2_Click(object sender, EventArgs e)
{
switch (f)
{
case true:
{
if (TextBox1.Text.ToString() != "")
TextBox1.Text = TextBox1.Text + "2";
else TextBox1.Text = "2";
};
break;
case false:
{
if (TextBox2.Text != "")
TextBox2.Text = TextBox2.Text + "2";
else TextBox2.Text = "2";
};
break;
}
}
//button3 click event
protected void Button3_Click(object sender, EventArgs e)
{
switch (f)
{
case true:
{
if (TextBox1.Text.ToString() != "")
TextBox1.Text = TextBox1.Text + "3";
else TextBox1.Text = "3";
};
break;
case false:
{
if (TextBox2.Text != "")
TextBox2.Text = TextBox2.Text + "3";
else TextBox2.Text = "3";
};
break;
}
}
//button4 click event
protected void Button4_Click(object sender, EventArgs e)
{
switch (f)
{
case true:
{
if (TextBox1.Text.ToString() != "")
TextBox1.Text = TextBox1.Text + "4";
else TextBox1.Text = "4";
};
break;
case false:
{
if (TextBox2.Text != "")
TextBox2.Text = TextBox2.Text + "4";
else TextBox2.Text = "4";
};
break;
}
}
//button5 click event
protected void Button5_Click(object sender, EventArgs e)
{
switch (f)
{
case true:
{
if (TextBox1.Text.ToString() != "")
TextBox1.Text = TextBox1.Text + "5";
else TextBox1.Text = "5";
};
剩余13页未读,继续阅读
wendyasdjkl
- 粉丝: 0
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 收起
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
会员权益专享
最新资源
- ExcelVBA中的Range和Cells用法说明.pdf
- 基于单片机的电梯控制模型设计.doc
- 主成分分析和因子分析.pptx
- 共享笔记服务系统论文.doc
- 基于数据治理体系的数据中台实践分享.pptx
- 变压器的铭牌和额定值.pptx
- 计算机网络课程设计报告--用winsock设计Ping应用程序.doc
- 高电压技术课件:第03章 液体和固体介质的电气特性.pdf
- Oracle商务智能精华介绍.pptx
- 基于单片机的输液滴速控制系统设计文档.doc
- dw考试题 5套.pdf
- 学生档案管理系统详细设计说明书.doc
- 操作系统PPT课件.pptx
- 智慧路边停车管理系统方案.pptx
- 【企业内控系列】企业内部控制之人力资源管理控制(17页).doc
- 温度传感器分类与特点.pptx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论1