标题:c# 检测到无法访问的代码 (CS0162) 怎么处理是怎么回事,求大佬们解答啊
只看楼主
大白小白
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2019-3-14
结帖率:0
已结贴  问题点数:20 回复次数:1 
c# 检测到无法访问的代码 (CS0162) 怎么处理是怎么回事,求大佬们解答啊

{
    /// <summary>
    /// Description of MainForm.
    /// </summary>
    public partial class MainForm : Form
    {
        public MainForm()
        {
            //
            // The InitializeComponent() call is required for Windows Forms designer support.
            //
            InitializeComponent();
            
            //
            // TODO: Add constructor code after the InitializeComponent() call.
            //
        }
        
        void Button1Click(object sender, EventArgs e)
        {
            double d=0;
            string b=textBox2.Text.ToString();
            double a=double.Parse(textBox1.Text);
            double c=double.Parse(textBox3.Text);

            if("b"=="+")
                d=a+c;
            else if("b"=="-")
                d=a-c;
            else if("b"=="*")
                d=a*c;
            else if("b"=="/")
                d=a/c;
            else
            MessageBox.Show("亲,超出我的能力范畴了哦!","这是一个弱弱的的警告yeah~!");
            textBox4.Text=d.ToString();
        }
    }
}
搜索更多相关主题的帖子: c# 检测 InitializeComponent double Text 
2019-03-23 17:26
zbjzbj
Rank: 12Rank: 12Rank: 12
来 自:郑州
等 级:贵宾
威 望:52
帖 子:620
专家分:3020
注 册:2011-4-22
得分:20 
            if (b == "+")
                d = a + c;
            else if (b == "-")
                d = a - c;
            else if (b == "*")
                d = a * c;
            else if (b == "/")
                d = a / c;
            else
2019-03-23 22:42



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




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

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