如何从文件夹中删除图像? [英] how to delete image from folder?
本文介绍了如何从文件夹中删除图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用图像控件在gridview中显示图像。所有图像都存储在文件夹中,我只是在数据库中保存该图像的路径。所以我想要帮助这样做,当我使用删除按钮从gridview中删除该图像时,它也将从该文件夹中删除。
I showing images in gridview using image control.That all images stored in folder,i just save path of that image in database.so i want help to doing like this,When i delete that image from gridview by using button of delete,it will also delete from that folder.
推荐答案
使用System.File类并调用File.Delete(路径)
http:// msdn .microsoft.com / zh-cn / library / system.io.file.delete(v = vs.110).aspx [ ^ ]
Use the System.File class and call File.Delete(path)
http://msdn.microsoft.com/en-us/library/system.io.file.delete(v=vs.110).aspx[^]
这篇关于如何从文件夹中删除图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文