Ome*_*GUL 4 .net c# winforms windows-hello
我可以编写一个代码块,在单击按钮时打开 Windows Hello 窗口并根据密码的正确性采取操作吗?如果我会写,我会怎样写?
我正在研究:Windows Forms .NET Framework (C#)
对于 .NET Framework WinForms 应用程序,您需要执行以下步骤:
\nMicrosoft.Windows.SDK.Contracts
包。在 NuGet 包管理器窗口的右侧窗格中,根据要定位的 Windows 10 版本选择所需的包版本,然后单击“安装”。Microsoft.NETCore.UniversalWindowsPlatform
包并安装。// Required using statements:\n// using Windows.Security.Credentials;\nprivate async void button1_Click(object sender, EventArgs e)\n{\n bool supported = await KeyCredentialManager.IsSupportedAsync();\n if (supported)\n {\n KeyCredentialRetrievalResult result =\n await KeyCredentialManager.RequestCreateAsync("login", \n KeyCredentialCreationOption.ReplaceExisting);\n if (result.Status == KeyCredentialStatus.Success)\n {\n MessageBox.Show("Logged in.");\n }\n else\n {\n MessageBox.Show("Login failed.");\n }\n }\n}\n
Run Code Online (Sandbox Code Playgroud)\n结果如下:
\n\n要了解更多信息,请查看以下文档:
\n\n 归档时间: |
|
查看次数: |
2243 次 |
最近记录: |