/// /// 指定路径删除文件 /// 注意:文件的删除要求指定路径文件必须存在 /// /// 路径 public void deleteMyFile ( string strPath ) { if ( File.Exists ( strPath ) ) { File.Delete ( strPath ); MessageBox.Show ( "删除成功!" ); } else { MessageBox.Show ( "要删除文件不存在!" ); } }