【问题标题】:My vb.net application crashes on openfileDialog using windows 10 OS我的 vb.net 应用程序在使用 Windows 10 操作系统的 openfileDialog 上崩溃
【发布时间】:2018-05-16 06:25:00
【问题描述】:

我的 vb.net 应用程序 openfileDialogwindows 7 上运行良好,但在 Windows 10 上崩溃。我已经在 windows 10 操作系统上启用了 3.5 框架,但仍然没有运气。 这是我的代码:

 Dim OpenFileDialog1 As New OpenFileDialog
        Try
            OpenFileDialog1.Filter = "Picture Files (*)|*.bmp;*.gif;*.jpg;*.png"
            If OpenFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
                OpenFileDialog1.ShowHelp = True
                pbAttachments.Image = Image.FromFile(OpenFileDialog1.FileName)

            Path_And_File_Name = OpenFileDialog1.FileName
            ImgFileSize = My.Computer.FileSystem.GetFileInfo(Path_And_File_Name).Length

            DoubleBytes = CDbl(ImgFileSize / 1048576) 'MB
            ImgFileSize_MB = FormatNumber(DoubleBytes, 2)

            If ImgFileSize_MB > 3 Then
                MsgBox("Image attachment is limited to 3 MB, the image file size you are trying to upload is " & ImgFileSize_MB & " MB!" & vbCrLf & "Please rezize your Image!", vbExclamation)
                Exit Sub
            End If
        End If
    Catch ex As Exception
        MsgBox(ex.Message)
    Finally
        ReleaseMemory()
        OpenFileDialog1.Dispose()
    End Try

请帮忙,谢谢!

【问题讨论】:

  • 1) 这是一个 WinForms 应用程序吗? 2)ReleaseMemory 是做什么的? 3)检查this question
  • ReleaseMemory() 函数只是为了减少应用程序的内存消耗。我已经尝试删除它,但它并不能解决问题先生。 :(
  • 是的,这是一个 Winform 应用程序。
  • Accounting System.exe 中 0x614bed6f 处未处理的异常:0xC000041D:在用户回调期间遇到未处理的异常。

标签: vb.net visual-studio-2010


【解决方案1】:

我通过重新安装 Windows 10 操作系统然后重新启用 framework 3.5 解决了这个问题

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-12-09
    • 1970-01-01
    • 2020-10-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多