哪位大哥帮看下 为什么openFileDialog.FileName返回不了正确的文件名

求大神指教程序后 File.Exists(path)是false,path变量值是“openFileDialog1”

 
 
 private void button2_Click(object sender, EventArgs e)
        {
            OpenFileDialog of = new OpenFileDialog();
            of.Title = "请选择图片";
            //of.Filter = "Bmp File(*.bmp)|*.bmp|jpg File(*.jpg)|*.jpg|All File(*.*)|*.*";
            if (of.ShowDialog()== DialogResult.OK)
            {
                String path = openFileDialog1.FileName;
                if (File.Exists(path))
                {
                    Image p2 = Image.FromFile(path);
                    //Image p2 = new Bitmap("C:/Users/苏亮亮/Pictures/马云.jpg");
                    pictureBox1.Image = p2;
                }
                
            }
        }
        
        

查看回复