Мое приложение vb.net openfileDialog
отлично работает на windows 7
, но оно зависает на Windows 10. Я уже включил 3.5 Framework на моей windows 10
ОС, но все равно не повезло.
вот мой код:
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
Пожалуйста, помогите, спасибо!