C# 文件选择

OpenFileDialog fileDialog = new OpenFileDialog();
            fileDialog.Multiselect = true;
            fileDialog.Title = "请选择文件";
            fileDialog.Filter="所有文件(*.*)|*.*";
            if (fileDialog.ShowDialog() == DialogResult.OK)
            {
                string file=fileDialog.FileName;
                MessageBox.Show("已选择文件:" + file,"选择文件提示",MessageBoxButtons.OK,MessageBoxIcon.Information);
            }

 

posted @ 2012-12-12 17:14  麦田HH  阅读(193)  评论(0编辑  收藏  举报