标题:刚学C# 大家帮帮忙,这个总是有错误,不知道错在哪
取消只看楼主
小歪33
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2011-4-29
 问题点数:0 回复次数:2 
刚学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();
        }
        }
    }
}
搜索更多相关主题的帖子: private 
2011-04-29 11:32
小歪33
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2011-4-29
得分:0 
回复 楼主 小歪33
总是提示缺少调试目标,无法开始调试!
2011-04-29 11:34
小歪33
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2011-4-29
得分:0 
不是很理解你们是什么意思,不过我把
private void Form1_Load(object sender, EventArgs e)
        {
            static void Main()
            {
                Application.Run(new Form1());
            }

去掉之后就好了!谢谢各位!
2011-05-01 11:06



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-338345-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.056544 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved