The method DeleteSubKey() deletes a key, but only if there are no subkeys for the specified key. The method DeleteSubKeyTree() deletes a key and any subkeys of the specified key.
4.
The StreamWriter class is used to write to a text file, whereas the StreamReader class is used to read data from a text file.
5.
The ReadToEnd() method.
6.
An exception is thrown.
Exercises
1.
Every toolbar item should have a corresponding menu item. Create a menu item on the Tools menu for displaying the log. While you're at it, create one for viewing the file properties to match the toolbar item you created in the previous hour.
2.
Create a button on the Log Viewer form called btnClearLog. Change the text of the button to Clear. When the user clicks the button, delete the log file from the hard drive and close the Log Viewer form.