刚学C# 大家帮帮忙,这个总是有错误,不知道错在哪
using System;using System.Collections.Generic;
using
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace WindowsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
static void Main()
{
Application.Run(new Form1());
}
private void button1_Click(object sender, EventArgs e)
{
long op1,op2,result;
if ((textBox1.Text =="")||(textBox2.Text ==""))
{
MessageBox.Show(this,"null","msg",MessageBoxButtons.OK ,
MessageBoxIcon.Information );
return;
}
try
{
op1=Convert.ToInt64(textBox1.Text );
op2=Convert.ToInt64(textBox2.Text );
result=op1+op2;
rextBox3.Text=Convert.ToString (result );
}
catch(Exception e1)
{
MessageBox.Show
(this,e1.Message ,"msg",MessageBoxButtons.OK,MessageBoxIcon.Warning );
}
}
private void button2_Click(object sender, EventArgs e)
{
this.Close();
}
}
}
}