I've recently needed to test an app on Windows XP that makes use of Windows Authentication for the application as well as for the Sql connection string, with different application functionality assigned to Windows users, and the various permissions that are set in Sql. Short of having to log in and out with every different user (which wasn't going to happen), I wasn't sure how this was going to happen, until I remembered the "runsas" DOS command.
Simply put, you can enter the following:
C:\>RUNAS.EXE /USER:<UserYouWantToRunAs> <ApplicationToRun>
On a few occasions I needed to debug some of the code, running as a specific user. I found two ways to do this, the first is to run Visual Studio as this user , the other is to add to you entry point of your app (and maybe put #if DEBUG #endif around this)
if (!System.Diagnostics.Debugger.IsAttached)
System.Diagnostics.Debugger.Launch();
This starts your configured debugger (or gives you a choice of which debugger to use) and is immediately attached.