I want to get image from the file..I m able to do it....But mine code do not close the file,after getting the image,I want to close the file.Cz after getting the image,I want to delete that file.....on Deleteing error is dere file is user by another process...
Public Sub GetImagesContent(ByVal sFileName As String)
Try
Dim sExtension As String
Dim img As System.Drawing.Image
sExtension = System.IO.Path.GetExtension(sFileName)
If Trim(sExtension) = ".bmp" Or _
Trim(sExtension) = ".jpg" Or _
Trim(sExtension) = ".jpeg" Or _
Trim(sExtension) = ".gif" Or _
Trim(sExtension) = ".png" Then
img = Image.FromFile(sFileName)
ImgThumbNailView.Images.Add(img)
End if
IS Image.FromFile do not close the file????
Suppose I convert string to fileinfo object
dim a as fileinfo=new fileinfo(sFileName)
How to close the file,Can somebody tell me?