Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/308.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/security/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# “记住我”选项的用户名和密码字段与winforms中的web浏览器相同_C#_Winforms - Fatal编程技术网

C# “记住我”选项的用户名和密码字段与winforms中的web浏览器相同

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

我需要像其他流行的web浏览器一样,在win forms web browser c#应用程序中存储或记住用户名和密码字段值的“我”选项。 例如:在winforms浏览器中,它总是在没有任何记忆值的情况下显示。

但是我需要存储用户名和密码值。喜欢

我是这样做的

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浏览器应用程序中加载网页。