如果文件被删除,如何获取文件名 [英] how to get a file name if file is delete

查看:95
本文介绍了如果文件被删除,如何获取文件名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从Upload folder删除一个文件。为此,下面给出了一个路径。但问题是如何获取文件名....









string path = Server.MapPath(G:/ BuidMyPc / Build My PC / Upload / +);

system.Io.File.Delete(path);

i want to delete a file from Upload folder.and for that a path is given below.but the question is how to get a file name....




string path = Server.MapPath(G:/BuidMyPc/Build My PC/Upload/ + );
system.Io.File.Delete(path);

推荐答案

如果从网站删除文件,只需将一个文件夹移动到另一个文件夹(即将文件夹上传到Delete_Upload)文件夹)。



然后自动你可以使用文件类 [ ^ ]
If you delete file from web site just move the one folder to another folder(i.e Upload folder to Delete_Upload) folder).

then automatically you can get the file name from delete_upload folder using File class [^]


这篇关于如果文件被删除,如何获取文件名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆