Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable “Security Warning” window in Webbrowser control

I'm using Webbrowser control to login to HTTPS site. but I get popup "Security Warning":

Security Warning window

the codes below do n't work.why?

ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(ValidateServerCertificate);

    public static bool ValidateServerCertificate(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
    {
        return true;
    }

where should i put these codes?

also there is another old thread in stackoverflow with a codeproject link.
it does not work too...

How can I disable this alert?

i am using visual studio 2010 & .net 4...

thanks in advance

like image 311
SilverLight Avatar asked Aug 31 '12 19:08

SilverLight


1 Answers

Change ScriptErrorsSuppressed property of WebBrowser control to true.

like image 188
Kuba Wyrostek Avatar answered Oct 28 '22 18:10

Kuba Wyrostek