码迷,mamicode.com
首页 > Windows程序 > 详细

C# OpenFileDialog用法

时间:2015-09-24 22:51:30      阅读:293      评论:0      收藏:0      [点我收藏+]

标签:

private void button1_Click(object sender, EventArgs e)
{
      OpenFileDialog fileName = new OpenFileDialog();
      fileName.InitialDirectory = Application.StartupPath;
      fileName.Filter = "所有文件(*.*)|*.*|菜单文件(*.md)|*.md";
      fileName.FilterIndex = 2;
      fileName.RestoreDirectory = true;
      if (fileName.ShowDialog() == DialogResult.OK) {
               //MessageBox.Show(fileName.FileName);
              //Stream stream=fileName.OpenFile();
              //StreamReader sr = new StreamReader(stream);
             //BinaryReader br = new BinaryReader(stream, Encoding.Unicode);
       }
}

C# OpenFileDialog用法

标签:

原文地址:http://www.cnblogs.com/huangbingzhi/p/4836725.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!