The section of the web site provides small code fragments which show you how to implement simple things in C# (or occasionally VB6).
It currently includes a piece on using Windows defrag also.