如何从不在数据库中的文件系统中删除图像文件 [英] How to delete image files from a filesystem which is not in database
本文介绍了如何从不在数据库中的文件系统中删除图像文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我有应用程序,我通过该应用程序上传数据库中的数据,数据库和一个文件夹中的数据。
我想开发一个控制台应用程序,通过它我想从数据库和文件夹中删除不需要的文件。
我有我的存储过程,删除所有数据来自数据库除了顶部10.现在我想删除不在数据库中的图像文件。
请给出一些相关的解决方案。
问候
解决方案
您将如何检查?
我的意思是你把这些图像的路径存储在数据库中了吗?如果是,那么从数据库中获取那些不需要的路径并删除它们。
Directory.GetFiles(@ c:\ MyDir \)
在使用Above语句之前,请从数据库中获取路径。
请查看以下链接以获取更多信息。
http://www.csharp-examples.net/ delete-all-files / [ ^ 一>
Hi All,
I have application through which i am uploading data like images,videos in database and in one folder.
I want to develop a console application through which i want to delete unwanted files from database as well as from folder.
I have my stored procedure which deletes all the data from database except top 10.Now i want to delete the image files which is not in database.
Please give some relevant solution.
Regards
解决方案
hi,
How will u check?
I mean have u stored the path of those images in database? if yes, then get those unwanted paths from the database and delete them.
Hi,
Directory.GetFiles(@"c:\MyDir\")
Before using the Above statement get the paths from the database.
Please look into the below link for further information.
http://www.csharp-examples.net/delete-all-files/[^]
这篇关于如何从不在数据库中的文件系统中删除图像文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文