• 0

The process cannot access the file


Question

Here is my VB.net 2010 code when a cell in a datagrid is clicked strPath being set to the full path of the file 

 

                Dim fs As New FileStream(strPath, FileMode.Create, FileAccess.Write
                k = UBound(myData)
                If k > 0 Then
                    fs.Write(myData, 0, k)
                    fs.Flush()
                    fs.Close()
                    fs.Dispose()
                    picImage.Load(strPath)
                    picImage.SizeMode = PictureBoxSizeMode.Zoom
                Else
                    fs.Close()
                    fs.Dispose()
                End If

 

The next time the code is accessed, ie  a cell in the datagrid is clicked I get a "The process cannot access the file" error

 

 

 

Link to comment
https://www.neowin.net/forum/topic/1383522-the-process-cannot-access-the-file/
Share on other sites

1 answer to this question

Recommended Posts

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.