c# 打开文件库
2021-02-05 08:15
标签:ogr sts ISE gre filter tle 打开文件 pen ict using (OpenFileDialog ofd = new OpenFileDialog()) c# 打开文件库 标签:ogr sts ISE gre filter tle 打开文件 pen ict 原文地址:https://www.cnblogs.com/ruiyuan/p/11445692.html
{
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("你没有选择图片", "信息提示");
}
}