I have a Windows Form Application that loads up a datagridview. In one of the columns is hyperlinks to image files. When these links are clicked my code shown below runs to open up the image. However, I have a new user on the system that has issues viewing any of the images.
At first it was found that the user did not have access to one of the subfolders in the image path. After this was corrected, the user can now access the full image path and view images through the windows explorer.
However, when running the application and clicking the hyperlinks, my user is receiving:
Error: Access to the path '\\Server\folder1\folder2\folder3\image.tif' is denied. In Procedure: FQImagingFilteredDataGridView_CellClick
Any ideas for what is going on? The user has full rights to the directory, even individual rights, and can now successfully view the images through windows explorer, but the application still treats the user as denied.
Here is my code:
Private Sub FQImagingFilteredDataGridView_CellClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles FQImagingFilteredDataGridView.CellClick
Try
If e.RowIndex = -1 Then Exit Sub
If e.ColumnIndex <> 0 Then Exit Sub
Dim ImageFile As String = FQImagingFilteredDataGridView.CurrentRow.Cells("FILEPATH").Value.ToString & "\" & FQImagingFilteredDataGridView.CurrentRow.Cells("FILENAME").Value.ToString
If Not IO.File.Exists(ImageFile) Then
MsgBox("Image file not found - unable to display!", MsgBoxStyle.Information, "Attention!")
Exit Sub
End If
' Pass a memory stream version of image to ImageForm
Dim DisplayImage As Image = LoadMemoryImage(ImageFile)
If Not IsNothing(DisplayImage) Then
Using ImageDisplayForm As New ImageForm(DisplayImage, ImageFile, True)
With ImageDisplayForm
.Text = ImageFile.Substring(InStrRev(ImageFile, "\"))
.ShowDialog()
End With
End Using
End If
Catch ex As Exception
MsgBox("Error: " + ex.Message + " In Procedure: " + Miscellaneous.InvokedBy(), MsgBoxStyle.Information, Me.Text)
End Try
End Sub
Any assistance appreciated.