Click here to Skip to main content
15,908,841 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi All,
I created xml file dynamically it is saved in solution explorer perfectly.Now i want to delete xml file from that solution explorer.



Thanks & Regards

Hari
Posted

C#
myDoc.Load(FileUpload2.FileContent);
string XMLpath = Server.MapPath(ConfigurationSettings.AppSettings["PDFLocation"]) + FileUpload2.FileName;
myDoc.Save(XMLpath);
file = new FileInfo(XMLpath);

//here I check if the file is valid. If not, delete

file.Delete();
 
Share this answer
 
Comments
Hari Krishna Prasad Inakoti 6-Dec-12 3:36am    
It is not working?
Hi Friends,
I got Solution
System.IO.File.Delete("C:/Documents and Settings/harikrishnaprasad/My Documents/3Tier/XMLFILES/" + xmlfile_name + txtFileName.Text + ".xml");
 
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