WebView2:如何启用密码自动填充?

问题描述 投票:0回答:2

如何将 WebView2 上的“IsPasswordAutofillEnabled”属性更改为“TRUE”?

我已经阅读了Microsoft 页面无数次,但实际上无法弄清楚如何在 Visual Studio 中执行此操作。

javascript c# visual-studio webview2
2个回答
4
投票

此功能是

Microsoft.Web.WebView2 package 1.0.865-prerelease
的实验性功能,仅存在于该版本中。

如果要使用,只需在包引用界面添加如下包引用即可:

<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.865-prerelease" />

像这样修改属性:

webView.CoreWebView2.Settings.IsPasswordAutofillEnabled = true;(webView is the control's name)

这里是webview2的介绍文档。


0
投票

我在这里测试了一下,设置是自动保存而不是自动填充:

WebView.CoreWebView2.Settings.IsPasswordAutosaveEnabled = True

完美运行!

© www.soinside.com 2019 - 2024. All rights reserved.