c# 打开文件库

2021-02-05 08:15

阅读:777

标签: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


评论


亲,登录后才可以留言!