There's more to it than just supplying a userid and password, but it's not too difficult of a task. Bear in mind that you will want to Undo the impersonation when you're finished (RevertToSelf). You may need to call Undo before impersonating if the thread that you're on already has an impersonation context. You will also need to make sure that the userid that is calling Impersonate has the appropriate logon privilege. This is dependent on the type of token you request (in essence, interactive vs. network or batch). If you need to connect to another machine on the network, then you'll need an interactive token. Otherwise, go with the least required privilege.
You'll be using the WindowsIdentity class, which has a nice write-up and sample in the product documentation. Have a look and let me know if you have questions.
http://msdn2.microsoft.com/en-us/library/chf6fbt4.aspx
Doug Rothaus
Visual Basic UE
douglasr@microsoft.com