I am trying to delete local copy(on the computer) of an image file once uploaded using file dialog. It throws The process cannot access the file \'C:\\Documents and Settings\\us
you need to dispose of the bitmap object try doing this. As this will dispose of the bitmap object as soon as it leaves the using context { }
using (Bitmap bitmap1 = new Bitmap(FilePathCopy)) { //do all bitmap stuff in here }