Possible Duplicate:
how to delete a file?
My application first reads the fields in windows form and then creates a csv file and writes all the fields values in the csv format in it. Then my application reads the csv file and uses it for its further processing. My requirement is that after my application has read the csv file, the file should automatically get deleted(security reasons).
How can i do the above using c# code.
You can use
System.IO.File.Delete(FilePath), whereFilePathis the file you would like to delete.Documentation on this
If you concerned about security, perhaps you should look into some alternatives to temporarily writing the data to a file on disk.