For what OS? If it's Windows NT/2000/XP, you can just use RD with the /s
option to remove an entire directory tree.
To code your own, look into the System.IO namespace. Particularly at the
Directory, DirectoryInfo, File, and FileInfo classes. They contain all the
methods you need.