图片问题
我在picturebox上打开了一幅图片,并且备份了一附件,我对附件进行操作,当我想关闭该图片(并不关闭窗口)的同时怎样删掉附件?部分程序如下:
accessoryFileName = currentFileName.Insert(aa-4,"~1");
File.Copy(currentFileName,accessoryFileName,true);
Bitmap b = new Bitmap(accessoryFileName);
//bitmap = (Bitmap)b.Clone();
bitmap = b;
//删掉附件
private void MenuItemFile_Close(object sender, System.EventArgs e)
{
Redo = 0;
this.redo.Enabled = false;
this.undo.Enabled = false;
//this.bitmap.Dispose();
//this.bitmap = null;
//this.pictureBox1.Dispose();
this.Dispose();
File.Delete(accessoryFileName);//这里好像部队该怎么办???
this.Refresh();
}