回 帖 发 新 帖 刷新版面

主题:IO的意思

private void LoadOccupations()
        {
            try
            {
                System.IO.StreamReader er = new System.IO.StreamReader ("../../Occupation.txt") ;
                string input ;
                do
                {
                    input = er.ReadLine() ;
                    if (input = "")
                    {
                        this.comboBox1.Items.Add (input) ;
                    }
                }while (er.Peek () != -1) ;
                er.Close () ;
            }
            catch (System.Exception )
            {
                MessageBox.Show ("File no found") ;
            }
        }
中的System.IO是指什么IO又是什么。
还有就是er.Peek()的方法是做什么的。

回复列表 (共2个回复)

沙发

看下msdn

板凳

IO就是input/output c语言也有说过吧?
streamreader就是把文件当作流读进来
peek什么用法不知道
上面有提示 
直接判断readline!=null也能达到目的

我来回复

您尚未登录,请登录后再回复。点此登录或注册