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

c# 打开文件库

时间:2019-09-02 13:38:15      阅读:112      评论:0      收藏:0      [点我收藏+]

标签:ogr   sts   ISE   gre   filter   tle   打开文件   pen   ict   

using (OpenFileDialog ofd = new OpenFileDialog())
                    {
                        ofd.Title = "请选择要插入的图片";
                        ofd.Filter = "JPG图片|*.jpg|BMP图片|*.bmp|Gif图片|*.gif";
                        ofd.CheckFileExists = true;
                        ofd.CheckPathExists = true;
                        ofd.Multiselect = false;

                        if (ofd.ShowDialog() == DialogResult.OK)
                        {
                             path = ofd.FileName;
                            picHeadImg.ImageLocation = path; //PictureBox
                             

                        }
                        else

                        {

                            MessageBox.Show("你没有选择图片", "信息提示");

                        }

                    }

c# 打开文件库

标签:ogr   sts   ISE   gre   filter   tle   打开文件   pen   ict   

原文地址:https://www.cnblogs.com/ruiyuan/p/11445692.html

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