未处理的“System.FormatException”类型的异常出现在 mscorlib.dll 中。
来源:互联网 发布:流媒体直播服务器软件 编辑:程序博客网 时间:2024/06/05 21:18
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
namespace WindowsApplication1
{
/// <summary>
/// Form1 的摘要说明。
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.TextBox textBox2;
private System.Windows.Forms.TextBox textBox3;
private System.Windows.Forms.TextBox textBox4;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.TextBox textBox5;
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;
public Form1()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
//
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
}
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.textBox1 = new System.Windows.Forms.TextBox();
this.textBox2 = new System.Windows.Forms.TextBox();
this.textBox3 = new System.Windows.Forms.TextBox();
this.textBox4 = new System.Windows.Forms.TextBox();
this.button1 = new System.Windows.Forms.Button();
this.textBox5 = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(144, 48);
this.textBox1.Name = "textBox1";
this.textBox1.TabIndex = 0;
this.textBox1.Text = "";
//
// textBox2
//
this.textBox2.Location = new System.Drawing.Point(312, 48);
this.textBox2.Name = "textBox2";
this.textBox2.TabIndex = 1;
this.textBox2.Text = "";
//
// textBox3
//
this.textBox3.Location = new System.Drawing.Point(464, 48);
this.textBox3.Name = "textBox3";
this.textBox3.TabIndex = 2;
this.textBox3.Text = "";
//
// textBox4
//
this.textBox4.Location = new System.Drawing.Point(136, 104);
this.textBox4.Name = "textBox4";
this.textBox4.TabIndex = 3;
this.textBox4.Text = "";
//
// button1
//
this.button1.Location = new System.Drawing.Point(360, 104);
this.button1.Name = "button1";
this.button1.TabIndex = 4;
this.button1.Text = "=";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// textBox5
//
this.textBox5.Location = new System.Drawing.Point(488, 96);
this.textBox5.Name = "textBox5";
this.textBox5.TabIndex = 5;
this.textBox5.Text = "";
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(792, 266);
this.Controls.Add(this.textBox5);
this.Controls.Add(this.button1);
this.Controls.Add(this.textBox4);
this.Controls.Add(this.textBox3);
this.Controls.Add(this.textBox2);
this.Controls.Add(this.textBox1);
this.Name = "Form1";
this.Text = "Form1";
this.Load += new System.EventHandler(this.Form1_Load);
this.ResumeLayout(false);
}
#endregion
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void Form1_Load(object sender, System.EventArgs e)
{
}
private void button1_Click(object sender, System.EventArgs e)
{
int a=int.Parse(this.textBox1.Text.ToString().Trim());
int b=int.Parse(this.textBox2.Text.ToString().Trim());
int c=int.Parse(this.textBox3.Text.ToString().Trim());
int d=int.Parse(this.textBox4.Text.ToString().Trim());
int resutl=a+b+c+d;
this.textBox5.Text=resutl.ToString();
// string a=this.textBox1.Text.ToString().Trim();
// string b=this.textBox2.Text.ToString().Trim();
// string c=this.textBox3.Text.ToString().Trim();
// string d=this.textBox4.Text.ToString().Trim();
// string resutl=a+b+c+d;
// this.textBox5.Text=resutl;
}
}
}
- 未处理的“System.FormatException”类型的异常出现在 mscorlib.dll 中。
- 未处理的“System.FormatException”类型的异常出现在 mscorlib.dll 中
- 在 System.FormatException 中第一次偶然出现的“mscorlib.dll”类型的异常,如何调试呢。
- 未处理的“System.StackOverflowException”类型的异常出现在 mscorlib.dll
- “在 System.Threading.ThreadAbortException 中第一次偶然出现的‘mscorlib.dll’类型的异常”的解决方法
- 在 System.Threading.ThreadAbortException 中第一次偶然出现的“mscorlib.dll”类型的异常
- 关于--在 System.Threading.ThreadAbortException 中第一次偶然出现的“mscorlib.dll”类型的异常(转)
- 在 System.Threading.ThreadAbortException 中第一次偶然出现的“mscorlib.dll”类型的异常
- 关于--在 System.Threading.ThreadAbortException 中第一次偶然出现的“mscorlib.dll”类型的异常(转)
- 在 System.Threading.ThreadAbortException 中第一次偶然出现的“mscorlib.dll”类型的异常
- “System.StackOverflowException”类型的未经处理的异常出现在 mscorlib.dll 中。
- 关于--在 System.Threading.ThreadAbortException 中第一次偶然出现的“mscorlib.dll”类型的异常
- 在 System.Threading.ThreadAbortException 中第一次偶然出现的“mscorlib.dll”类型的异常
- 关于--在 System.Threading.ThreadAbortException 中第一次偶然出现的“mscorlib.dll”类型的异常
- “System.ArgumentException”类型的未经处理的异常出现在 mscorlib.dll 中。
- NPOI 在 System.IO.FileNotFoundException 中第一次偶然出现的“mscorlib.dll”类型的异常
- 在 System.Threading.ThreadAbortException 中出现的“mscorlib.dll”类型的异常
- 未处理的“System.Data.SqlClient.SqlException”类型的异常出现在 system.data.dll 中。
- 数据库操作类
- ASPNETDB 存储过程(4) 个性化用户配置部分
- .NET多线程同步方法详解(二):互斥锁(lock)
- 团队成员的五种需求及其满足方式
- 如何在子线程中操作窗体上的控件
- 未处理的“System.FormatException”类型的异常出现在 mscorlib.dll 中。
- java中文与编码
- 转:组合算法
- 未处理的“System.FormatException”类型的异常出现在 mscorlib.dll 中
- Prototype.Js
- 转:20世纪最好的10个算法
- 项目管理的20条锦囊妙计
- Tomcat—SQL Server 2000环境下的数据库连接池的配置
- 关于跨浏览器事件(EVENT)