open file C#

   private void button13_Click(object sender, EventArgs e)
        {
            OpenFileDialog ofd = new OpenFileDialog();
            ofd.Filter = "Word Documents(*.doc)|*.doc";
            ofd.ShowDialog();
            textBox3.Text = ofd.FileName;
        }

   private void button12_Click(object sender, EventArgs e)
        {
            if (textBox3.Text.Length > 0)
            {
                readFileContent(textBox3.Text);
            }
            else
            {
                MessageBox.Show("Enter a valid file path");
            }
        }

   private void readFileContent(string path)
        {

           ...

        }

 

posted @ 2009-12-31 13:30  greencolor  阅读(352)  评论(0编辑  收藏  举报