Prompting for password on process.start.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am writting a program that has a button that a user can click to start
isntalltions of various software across the network. Some of the software is
on a network share that is password protected. I need the program to prompt
for a username and password if it tries to start the program and needs
authentication. This should appear in practically the same way as if the user
had typed the network path into their run box. If the user isn't
authenticated to the server it prompts for the username and password.
 
In short, very carefully, since getting a user's password is serious
business :)

The best way is to PInvoke CredUIPromptForCredentials. This is only
available on XP and 2003, however.

There is some sample code here (in VB.NET):
http://msdn.microsoft.com/vstudio/u.../en-us/dnnetsec/html/dpapiusercredentials.asp

Keith Brown has some good suggestions here:
Item 71: How to prompt for a password
http://www.pluralsight.com/keith/book/html/howto_promptpwd.html
He is using managed C++ to call CredUIPromptForCredentials.

Let me know if this helps,
 
Back
Top