读取文件内容

StreamReader sr = new StreamReader(Application.StartupPath+"\\Menu.ini");
            int i = 文件ToolStripMenuItem.DropDownItems.Count - 1;
            while (sr.Peek() > 0)
            {
                ToolStripMenuItem mnu = new ToolStripMenuItem(sr.ReadLine());
                文件ToolStripMenuItem.DropDownItems.Insert(i,mnu);
                i++;
                mnu.Click+=new EventHandler(mnu_Click);
            }
            sr.Close();

你可能感兴趣的:(读取文件)