日期:2014-05-17  浏览次数:20769 次

怎么会报错显示不存在read2write方法
protected void Button1_Click(object sender, EventArgs e)
    {
        if (RadioButtonList1.SelectedValue != "")
        {
            int selectvalue = Convert.ToInt32(RadioButtonList1.SelectedValue);

           switch(selectvalue)
            {
                case 1:
                    read2write(1);
                    break;
                case 2:
                    read2write(2);
                    break;
                case 3:
                    read2write(3);
                    break;
                case 4:
                    read2write(4);
                    break;
            }
button

------解决方案--------------------
如果你只想编译通过,最简单的就是定义一个(当然啥也没有做)
void read2write(int n) { }
写在窗体类定义的空白处,不要写在函数里面哦。