开发者

Windows native password prompt from .NET

What is the best way to prompt a user for username/password using .NET 4? I could build my own promp开发者_JS百科t 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.


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:

Windows native password prompt from .NET

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜