Salat
Well-known member
Im useing such a code
where stream is a whole image file structure (binaries)
When I call this code once, everything is ok, but when I call it second time then this exception occurs at "FileOpen" line
An unhandled exception of type System.IO.IOException occurred in microsoft.visualbasic.dll
Additional information: The process cannot access the file "d:\Moje dokumenty\PIOTREK\Visual Studio Projects\EasyForms\bin\EFImaSaveTmp1.jpg" because it is being used by another process.
What is wrong? this file is closed...
Code:
Dim BackGround as Image
Dim ffi As Integer = FreeFile()
Dim ImaPath As String = Application.StartupPath & "\EFImaSaveTmp.jpg"
FileOpen(ffi, ImaPath, OpenMode.Binary, OpenAccess.Write, OpenShare.Shared)
FilePut(ffi, stream)
FileClose(ffi)
BackGround = Image.FromFile(ImaPath)
When I call this code once, everything is ok, but when I call it second time then this exception occurs at "FileOpen" line
An unhandled exception of type System.IO.IOException occurred in microsoft.visualbasic.dll
Additional information: The process cannot access the file "d:\Moje dokumenty\PIOTREK\Visual Studio Projects\EasyForms\bin\EFImaSaveTmp1.jpg" because it is being used by another process.
What is wrong? this file is closed...