Click here to Skip to main content
15,898,134 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Posted

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.
 
Share this answer
 
you can use this line of code to do your task.
C#
System.IO.File.Delete("D:\\1.html");
 
Share this answer
 
Hi
just place ur file name and it will work with you 

C#
File.Delete( Server.MapPath( "~/filuupload/New_2.txt"));
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900