C# “记住我”选项的用户名和密码字段与winforms中的web浏览器相同
我需要像其他流行的web浏览器一样,在win forms web browser c#应用程序中存储或记住用户名和密码字段值的“我”选项。 例如:在winforms浏览器中,它总是在没有任何记忆值的情况下显示。 但是我需要存储用户名和密码值。喜欢 我是这样做的C# “记住我”选项的用户名和密码字段与winforms中的web浏览器相同,c#,winforms,C#,Winforms,我需要像其他流行的web浏览器一样,在win forms web browser c#应用程序中存储或记住用户名和密码字段值的“我”选项。 例如:在winforms浏览器中,它总是在没有任何记忆值的情况下显示。 但是我需要存储用户名和密码值。喜欢 我是这样做的 public partial class Form1 : Form{ private readonly string WebPage = "http://example.com"; public Form1
public partial class Form1 : Form{
private readonly string WebPage = "http://example.com";
public Form1()
{
InitializeComponent();
Navigation_func(WebPage);
}
private void Navigation_func(string address)
{
//check if the address is blank or null
if (string.IsNullOrEmpty(address))
return;
//check if the page is blank
if (address.Equals("about:blank"))
return;
//check if the page is start with http or https or file
if (!address.StartsWith("http://") && !address.StartsWith("https://") && !address.StartsWith("file:/"))
{
address = "http://" + address;
}
try
{
//Actual Navigation
//webBrowser1.Navigate(new Uri(address));
webBrowser1.Navigate(address);
}
catch (UriFormatException)
{
}
}
}
那么,您正在windows应用程序中加载网页?是的。我正在win forms web浏览器应用程序中加载网页。