C# Archive

In this i will show you that how can we delete file from the folder using c# Here is code ……….. DirectoryInfo di = new System.IO.DirectoryInfo("DirecotyPath"); FileInfo allFiles = di.GetFiles(searchPattern); foreach (FileInfo file in allFiles) { file.Delete(); }
If you want to export attributes from XML file to text file then you just have to read that attribute from xml & write it in text file…I have shown hoe to write string into text file Here …....
First You have to check whether file exists or not …if yes then just map the path & write string into file using streamwriter… if (File.Exists(Server.MapPath("logfile.txt"))) { FileStream aFile = new FileStream(Server.MapPath("logfile.txt"),FileMode.Append,FileAccess.Write); StreamWriter sw = new StreamWriter(aFile); sw.WriteLine("test to...