C# Credential Manager

Prompt for user credentials using CREDUI.

image

I have done this so many times in the past and then I always struggle because all the code samples are in VB.NET and I code in C#, so I thought, just do it and put it on your blog so others can use it and I can get to it easily in the future.

 

With the CredentialManager you can specify the target name, the parent form, banner bitmap and I am using a delegate to execute the success story.

   1: OnSuccess success = new OnSuccess(Success);


   2: CredentialManager.Connect("SomeApplication", null, success);


   3:  


   4: private static void Success(Credentials credentials)


   5: {


   6:     RunAs(credentials.UserId, credentials.Password, true);


   7: }






Sorry, Blogger doesn't support file uploads

Please:

1) Change to a different blog provider, then;

2) Save the draft

3) Change to HTML view, then back to the view you were on.

Your files will be ready to upload then.
Post a Comment

Popular Posts