A
alex
I hade some problems with file locking and did a simple test using
process explorer tool from sysinternals.
Bitmap BitmapInWork = new Bitmap(Server.MapPath(fileFullPath));
//at this point file referenced by fileFullPath is locked by aspnet
worker process
BitmapInWork = ResizeImage(BitmapInWork, intTargetWidth,..);
//at this point it is not locked anymore, at least process explorer
doesnt find any handles. and I can delete the file from the disk.
So what hapened to the lock? Was the BitmapInWork.Dispose()called
behind the scene? The question is do i need to use new variable on each
resize and dispose old instance like:
BitmapInWork2 = ResizeImage(BitmapInWork, intTargetWidth,..);
BitmapInWork.Dispose();
BitmapInWork3 = ResizeImage(BitmapInWork2, intTargetWidth,..);
BitmapInWork2.Dispose();
and so on or can I just use the same BitmapInWork for all work?
Thanks.
process explorer tool from sysinternals.
Bitmap BitmapInWork = new Bitmap(Server.MapPath(fileFullPath));
//at this point file referenced by fileFullPath is locked by aspnet
worker process
BitmapInWork = ResizeImage(BitmapInWork, intTargetWidth,..);
//at this point it is not locked anymore, at least process explorer
doesnt find any handles. and I can delete the file from the disk.
So what hapened to the lock? Was the BitmapInWork.Dispose()called
behind the scene? The question is do i need to use new variable on each
resize and dispose old instance like:
BitmapInWork2 = ResizeImage(BitmapInWork, intTargetWidth,..);
BitmapInWork.Dispose();
BitmapInWork3 = ResizeImage(BitmapInWork2, intTargetWidth,..);
BitmapInWork2.Dispose();
and so on or can I just use the same BitmapInWork for all work?
Thanks.