资源简介
该WinForm程序共包括4个窗体,除实现银行ATM基本存款取款、以及获取账户各种信息的功能外,还包括C#中的事件、委托、自定义异常,在用户错误输入、操作错误时会有提示或者抛出异常,并通过触发事件的形式,对可能的盗窃行为进行监控提示(一次性取款金额达到一定数量时)。具体功能可以参见我的博客https://blog.csdn.net/qq_42182367/article/details/82778209
(不适宜超级大佬)(资源如果有什么问题请联系我,会尽量完善的)

代码片段和文件信息
using System;
using System.Windows.Forms;
/* I totally change it from a ConsoleApp to this WinForm Program
* because WinForm is clearer for users I think
*
* I add several Events and Delegates
* also use several custom exceptions in this program
*/
namespace ATM
{
public partial class Form1 : Form
{
public static Account a = new Account();
public static CreditAccount ca = new CreditAccount();
public Form1()
{
InitializeComponent();
}
public static string name pass;
private string login_input_ID login_input_pass;
private void Form1_Load(object sender EventArgs e)
{
}
private void button1_Click(object sender EventArgs e)
{
Form2 f2 = new Form2();
name = pass = null;
f2.Show();
}
private void button3_Click(object sender EventArgs e)
{
if (!String.IsNullOrEmpty(login_input_ID)&&!String.IsNullOrEmpty(login_input_pass))
{
Form4 f4 = new Form4();
Form5 f5 = new Form5();
if (login_input_ID == a[0] && login_input_pass == a.password)
f4.Show();
else if (login_input_ID == ca[0] && login_input_pass == ca.password)
f5.Show();
else
MessageBox.Show(“wrong ID or password.“);
}
else
{ //use custom Exception Error number 0
try
{
Account.emptyInput(login_input_ID);
Account.emptyInput(login_input_pass);
}
catch (EmptyException ex)
{
MessageBox.Show(ex.Message + ex.getId());
}
}
}
private void textBox3_TextChanged(object sender EventArgs e)
{
}
private void textBox1_TextChanged(object sender EventArgs e)
{
this.textBox1.TextChanged += new System.EventHandler(this.textBox1_TextChanged);
login_input_ID = this.textBox1.Text;
}
private void textBox2_TextChanged(object sender EventArgs e)
{
this.textBox2.TextChanged += new System.EventHandler(this.textBox2_TextChanged);
login_input_pass = this.textBox2.Text;
}
}
public class BigMoneyArgs : EventArgs
{
public int ID;
public int amount_fetch;
}
public delegate void BigMoneyHandler(object sender BigMoneyArgs e);
//defining Exception classes
class SurpassException : ApplicationException
{
private int idnumber;
public SurpassException(String message int id) : base(message)
{
this.idnumber = id
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 2218 2018-10-13 14:13 WinForm_ATM\WinForm_ATM.sln
..A..H. 33280 2018-10-14 13:01 WinForm_ATM\.vs\WinForm_ATM\v15\.suo
文件 0 2018-10-14 13:00 WinForm_ATM\.vs\WinForm_ATM\v15\Server\sqlite3\db.lock
文件 4096 2018-10-14 13:01 WinForm_ATM\.vs\WinForm_ATM\v15\Server\sqlite3\storage.ide
文件 696312 2018-10-14 13:01 WinForm_ATM\.vs\WinForm_ATM\v15\Server\sqlite3\storage.ide-wal
文件 32768 2018-10-14 13:01 WinForm_ATM\.vs\WinForm_ATM\v15\Server\sqlite3\storage.ide-shm
文件 134 2018-10-14 13:01 WinForm_ATM\.vs\WinForm_ATM\DesignTimeBuild\.dtbcache
文件 189 2018-10-11 23:09 WinForm_ATM\ATM\App.config
文件 4533 2018-10-13 14:21 WinForm_ATM\ATM\ATM.csproj
文件 7396 2018-10-12 23:39 WinForm_ATM\ATM\Form1.Designer.cs
文件 5817 2018-10-13 00:12 WinForm_ATM\ATM\Form1.resx
文件 6109 2018-10-13 00:12 WinForm_ATM\ATM\Form2.Designer.cs
文件 5817 2018-10-13 00:12 WinForm_ATM\ATM\Form2.resx
文件 12584 2018-10-13 00:12 WinForm_ATM\ATM\Form4.Designer.cs
文件 5817 2018-10-13 00:12 WinForm_ATM\ATM\Form4.resx
文件 3831 2018-10-13 00:28 WinForm_ATM\ATM\Form5.cs
文件 14691 2018-10-13 00:28 WinForm_ATM\ATM\Form5.Designer.cs
文件 5817 2018-10-13 00:28 WinForm_ATM\ATM\Form5.resx
文件 515 2018-10-11 23:09 WinForm_ATM\ATM\Program.cs
文件 29696 2018-10-14 12:28 WinForm_ATM\ATM\bin\Debug\ATM.exe
文件 189 2018-10-11 23:09 WinForm_ATM\ATM\bin\Debug\ATM.exe.config
文件 62976 2018-10-14 12:28 WinForm_ATM\ATM\bin\Debug\ATM.pdb
文件 42 2018-10-12 23:18 WinForm_ATM\ATM\obj\Debug\ATM.csproj.CoreCompileInputs.cache
文件 2259 2018-10-13 14:14 WinForm_ATM\ATM\obj\Debug\ATM.csproj.FileListAbsolute.txt
文件 11490 2018-10-11 23:09 WinForm_ATM\ATM\obj\Debug\ATM.csprojAssemblyReference.cache
文件 29696 2018-10-14 12:28 WinForm_ATM\ATM\obj\Debug\ATM.exe
文件 180 2018-10-13 14:43 WinForm_ATM\ATM\obj\Debug\ATM.Form1.resources
文件 180 2018-10-13 14:43 WinForm_ATM\ATM\obj\Debug\ATM.Form2.resources
文件 180 2018-10-13 14:43 WinForm_ATM\ATM\obj\Debug\ATM.Form4.resources
文件 180 2018-10-13 14:43 WinForm_ATM\ATM\obj\Debug\ATM.Form5.resources
............此处省略40个文件信息
相关资源
- C# OCR数字识别实例,采用TessnetOcr,对
- 考试管理系统 - C#源码
- asp.net C#购物车源代码
- C#实时网络流量监听源码
- C#百度地图源码
- Visual C#.2010从入门到精通配套源程序
- Winform可视化打印模板设计工具含源码
- C# 软件版本更新
- C#屏幕软键盘源码,可以自己定制界面
- 智慧城市 智能家居 C# 源代码
- c#获取mobile手机的IMEI和IMSI
- C#实现简单QQ聊天程序
- 操作系统 模拟的 欢迎下载 C#版
- C#写的计算机性能监控程序
- 用C#实现邮件发送,有点类似于outlo
- MVC model层代码生成器 C#
- c#小型图书销售系统
- C# Socket Server Client 通讯应用 完整的服
- c# winform 自动登录 百度账户 源代码
- C#编写的16进制计算器
- C#TCP通信协议
- C# 数据表(Dataset)操作 合并 查询一
- C#语音识别系统speechsdk51,SpeechSDK51L
- 数据库备份还原工具1.0 C# 源码
-
[免费]xm
lDocument 节点遍历C# - EQ2008LEDc#开发实例
- DirectX.Capturec# winform 操作摄像头录像附
- c# 实现的最大最小距离方法对鸢尾花
- C#版保龄球记分代码
- C#自定义控件
评论
共有 条评论