This week's book giveaway is in the Testing forum. We're giving away four copies of The Way of the Web Tester: A Beginner's Guide to Automating Tests and have Jonathan Rasmusson on-line! See this thread for details.
This smells like homework. I don't fully understand what you want. You want to use both of these in the same program? Or are you asking for two different examples? Either way, you need to show what you have so far.