There is also a class which has the capability to delete files, registry subkeys and processes.
To delete files, the class first gets the file or directory using the Environment.GetFolderPath and Directory.GetFiles method and converts the file into the text variable, it will then use the method File.Delete(text) to delete the file.