是否要从solutionexplorer文件夹中删除文件? [英] want to delete file from solutionexplorer folder ?

查看:67
本文介绍了是否要从solutionexplorer文件夹中删除文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

要在button_click事件中从solutionexplorer文件夹中删除文件.
foldername:-filuupload(在解决方案资源管理器中)
asp.net c#
请帮我!

thanx提前

want to delete file from solutionexplorer folder on button_click event.
foldername :- filuupload(it is in solution explorer)
asp.net c#
plz help me!

thanx in advance

推荐答案

1.获取文件(Web应用程序)的虚拟目录路径或绝对路径(Windows应用程序).
2.使用File.Delete删除文件.

确保应用程序具有足够的权限来执行此操作.
1. Get the virtual directory path of file(web app) or absolute path(windows app).
2. Use the File.Delete to delete the file.

Make sure the application has sufficient privileges to do this.


您可以使用此行代码来执行任务.
you can use this line of code to do your task.
System.IO.File.Delete("D:\\1.html");


Hi
just place ur file name and it will work with you 


File.Delete( Server.MapPath( "~/filuupload/New_2.txt"));


这篇关于是否要从solutionexplorer文件夹中删除文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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