如何从asp.net中的文件夹中删除垂直上传的文件 [英] how to delete the perticular uploaded file from the folder in asp.net

查看:61
本文介绍了如何从asp.net中的文件夹中删除垂直上传的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨!我想删除asp.net中文件夹中垂直上传的文件.
还为我提供了从文件夹中删除垂直文件的代码.

Hi! i want to delete the perticular uploaded file in folder in asp.net.
also provide me the code for deleting the perticular file from the folder.

推荐答案

假设应用程序池帐户具有权限,则删除文件很容易.

Deleting a file, assuming the app pool account has permissions, is easy.

System.IO.File.Delete(pathToFile);


if( System.IO.File.Exists( "FilePathGoesHere" )
{
   System.IO.File.Delete( "FilePathGoesHere" );
}



如果这不是您想要的,那么您将需要使用 改进问题 小部件,并向我们提供更多信息



If this isn''t what you want, then you''ll need to use the Improve Question widget and provide us a little more information.


HI
string Yourfilename ="test.txt";
 File.Delete( Server.MapPath( "~/filuupload/" +Yourfilename));



最好的问候
米特瓦里(M.Mitwalli)



Best Regards
M.Mitwalli


这篇关于如何从asp.net中的文件夹中删除垂直上传的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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