首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

如何会报错显示不存在read2write方法

2013-03-19 
怎么会报错显示不存在read2write方法protected void Button1_Click(object sender, EventArgs e){if (Radi

怎么会报错显示不存在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) { }
写在窗体类定义的空白处,不要写在函数里面哦。

热点排行