当前位置:编程学习 > C#/ASP.NET >>

运行没错误,输入的信息显不出啊,为嘛?求解释

private void btnConfirm_Click_1(object sender, EventArgs e)
        {
            string msg;
            msg = txtname.Text.Trim();
            if (msg == "")
            {
                MessageBox.Show("姓名不能为空!", "提示");

            }
            if (RadMale.Checked)
                msg += ",男";
            else
                msg += ",女";
            if (txtage.Text.Trim() != "")
                msg += "," + txtage.Text.Trim() + "岁";
            if (txtNativePlace.Text.Trim() != "") ;
            msg += "," + txtNativePlace.Text.Trim() + "人";
            msg += "\n";
            string hobby; hobby = "";
            if (check1.Checked)
                hobby += "<" + check1.Text + ">";
            if (check2.Checked)
                hobby += "<" + check2.Text + ">";
            if (check3.Checked)
                hobby += "<" + check3.Text + ">";
            if (check4.Checked)
                hobby += "<" + check4.Text + ">";
            if (check5.Checked)
                hobby += "<" + check5.Text + ">";
            if (check6.Checked)
                hobby += "<" + check6.Text + ">";
            if (hobby != "")
                hobby = "爱好" + hobby;
            else
                hobby = "无爱好";
            msg += hobby;
            MessageBox.Show("msg", "信息确定");

        } --------------------编程问答-------------------- 想知道问题在哪很简单,自己下个断点,一句话一句话的走一遍不就知道了吗 --------------------编程问答-------------------- MessageBox.Show(msg, "信息确定");
--------------------编程问答-------------------- 二楼看出来了,多加了一对引号,谢了 --------------------编程问答--------------------
补充:.NET技术 ,  C#
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,