I thought this would be a very common practice, but I am having a hard time finding anything on how to show the user a default windows authentication credential prompt in c#?
Users will be using this windows forms app to connect to a web service on a different domain, so I cant just pass in the default credentials. These users will have a separa开发者_如何学Cte login to access the web service, and I want them to be prompted by the default Windows prompt, and then I can pass their creds through to the web service.
Thanks!
This was answered on SO a while back, I believe. You can use the credential management API. Here's a link with a code example that should get you started.
You need to P/invoke CredUIPromptForWindowsCredentials
on Vista and up, or CredUIPromptForCredentials
on XP.
精彩评论