There is no direct access to the TV guide for third-party code, due to the licensing agreement Microsoft have with their EPG provider. (Would make life so much easier if this changed...)
For Recorded TV, one way is to use the WMPLib interface to enumerate all video on the system, like this:
using WMPLib;
...
WindowsMediaPlayer player = new WindowsMediaPlayer();
IWMPPlaylist playlist = player.mediaCollection.getByAttribute("MediaType", "Video");
for (int i = 0; i (lessthan) playlist.count; i++)
{
IWMPMedia media = (IWMPMedia)playlist.get_Item(i);
string videopath = media.getItemInfo("SourceUrl");
string videotitle = media.getItemInfo("Title");
Debug.WriteLine("Found Video item: " + videotitle + " at " + videopath);
}
(You'll need to add a project reference to wmp.dll in your System32 folder as well, to get the Interop.WMPLib.dll interface library created.)
If you look at all the videos with .wtv or .dvr-ms file extensions, that will give you a list of Recorded TV programs.
Getting additional metadata from the programs is a bit trickier, but doable -- you need to read the metadata directly from the .dvr-ms or .wtv file. A good start is Stephen Toub's article here:
http://blogs.msdn.com/toub/archive/2005/05/12/416874.aspx
Eddy
P.S. It looks like I can't include angle brackets in messages any more; I think this is a change since moving to the new hosting center. Even using ampersand 'lt' semicolon doesn't work...