Пример #1
0
        private void 打开ToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            this.openFileDialog1.FileName = Environment.CurrentDirectory;
            if (this.listBox1.Items.Count >= 2)
            {
                SaveListBox();
            }
            this.openFileDialog1.ShowDialog();
            string filename = this.openFileDialog1.FileName;

            filenames.Add(filename);
            FileStreamUtil filestream = new FileStreamUtil();
            List <string>  list       = filestream.ReaderFile(filename);

            foreach (string str in list)
            {
                this.textBox1.Text += str;
            }
            this.listBox1.Items.Add(Path.GetFileName(filename));
        }