Check this code out -
System.Diagnostics.ProcessStartInfo myProcess =
new System.Diagnostics.ProcessStartInfo("Notepad.exe");
myProcess.UserName = "someusername"; //windows username
System.Security.SecureString password = new System.Security.SecureString();
// set value for password here.
myProcess.Password = password;
myProcess.UseShellExecute = false;
System.Diagnostics.Process.Start(myProcess);
What the above code does is, it runs the application notepad as the user "someusername".
Now that's just like RunAs - except it's programmatic !! :-) (.NET 2.0 only)