Delete .rtf file in a folder

Chong

Well-known member
Joined
Apr 4, 2003
Messages
79
Will anyone show me how to delete a .rtf file in a folder for me? When I click the Delete button on the form, I like the to program to go into a folder which I specified the path and delete a file that matches a criteria. Im using the SaveFileDiaglog to save the file, but I dont know how to delete it.

Many thanks for any help!

ljCharlie
 
Code:
System.IO.File.Delete("c:\test.rtf")

should do the trick - just replace the filename with the name of the file you want to delete.
 
Back
Top