【问题标题】:Empty OpenFileDialoge when open image打开图像时清空打开文件对话框
【发布时间】:2017-02-09 08:39:13
【问题描述】:

我设计了一个 vb.net 应用程序,它使用 OpenFileDialoge 在 PictureBox 中打开图片。
我的机器是 windows 7 32bit,这是我的代码:

    Dim directoryName As String = Path.GetDirectoryName(Application.ExecutablePath)
    Try
        Dim dialog As New OpenFileDialog
        directoryName = ""
        dialog.InitialDirectory = directoryName
        dialog.Filter = "Pictures|*.jpg|All files (*.*)|*.*"
        dialog.FilterIndex = 1
        dialog.RestoreDirectory = True
        If dialog.ShowDialog = DialogResult.OK Then
            TextBox8.Text = dialog.FileName
            PictureBox1.Image = Image.FromFile(TextBox8.Text)
        End If
    Catch ex As Exception
        MessageBox.Show(ex.Message.ToString)
    End Try  

在我的机器上一切都很好,但是在具有 windows 7 64bit 的客户端机器上,当他试图打开图像时,他得到了这样的图片:

另外,我尝试用不同版本更改 .Net 框架,但没有任何反应,请问有人有想法吗?

【问题讨论】:

    标签: vb.net openfiledialog


    【解决方案1】:

    经过 5 天的搜索和一次又一次尝试,我刚刚解决了我的问题。
    我使用 MS Acess 2010 数据库和我的程序作为后端,解决方案是将其转换为 MS Acess 2003。
    我不知道这有什么关系!但它已经解决了。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-05-12
      • 2010-12-11
      • 1970-01-01
      • 2018-11-02
      • 1970-01-01
      • 1970-01-01
      • 2022-01-23
      • 2011-02-04
      相关资源
      最近更新 更多