如何将 WebView2 上的“IsPasswordAutofillEnabled”属性更改为“TRUE”?
我已经阅读了Microsoft 页面无数次,但实际上无法弄清楚如何在 Visual Studio 中执行此操作。
此功能是
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)
我在这里测试了一下,设置是自动保存而不是自动填充:
WebView.CoreWebView2.Settings.IsPasswordAutosaveEnabled = True
完美运行!