1

What is the best way to prompt a user for username/password using .NET 4? I could build my own prompt using the WPF PasswordBox, but it seems like this should be part of the framework.

Ultimately I'd like it to work with Windows XP, Vista and 7, but Windows 7 is enough to get me started.

I have searched the web but the solutions I've found seem dated.

If there is a better way to authenticate users with WCF (using both Windows and UserName authentication) I'd be happy to know about it.

Greg Sansom
  • 20,442
  • 6
  • 58
  • 76
  • 1
    Has anyone found a better way of showing a native authentication prompt that can leverage the native Vista and Windows 7 dialogs yet? – Petrus Theron Dec 10 '10 at 13:16

1 Answers1

0

There's some code at How to show authentication dialog in C# .Net 3.5 SP1 which seems to work, although it shows the old school XP dialog:

alt text

It's about 100 lines of code - a bit much for such a common task which (IMO) should be part of the framework.

Community
  • 1
  • 1
Greg Sansom
  • 20,442
  • 6
  • 58
  • 76