我正在尝试使用此函数从中获取字节以将其发送到数据库
Public Function GetBinary(ByVal Path As String) As Byte()
Dim fStream As New FileStream(Path, FileMode.Open, FileAccess.Read, FileShare.None)
Dim fLen As Integer = fStream.Length
Dim br As New BinaryReader(fStream)
Dim data As Byte() = br.ReadBytes(fLen)
Return data
End Function
但是当我使用它时,它给出了一个错误似乎是我选择的文件正在被另一个应用程序打开,,,
错误信息 >
The process cannot access the file 'C:\Users\LOAI\Desktop\2011-11-23 15.47.36.jpg' because it is being used by another process.
如何选择没有此错误的文件并从图像中获取字节
此致