c# - Where to place RemoteCertificateValidationCallback? -
i have same problem here: how disable "security alert" window in webbrowser control
i answer, going place servicepointmanager.servercertificatevalidationcallback = new remotecertificatevalidationcallback(validateservercertificate);
?
i 'invalid certification' message after submit login page of school network code:
htmlelementcollection ellements = webbrowser.document.getelementsbytagname("input"); foreach (htmlelement ellement in ellements) { if (ellement.outerhtml == "<input onclick=\"this.value = 'submitted'\" value=\" login \" type=submit>") { ellement.invokemember("click"); this.dialogresult = dialogresult.ok; break; } }
thank much. :)
you should put following @ any point before show web browser control / submit page:
servicepointmanager.servercertificatevalidationcallback += new remotecertificatevalidationcallback((sender, certificate, chain, policyerrors) => { return true; });
(this same example answer in linked question, callback method anonymous little more compact).
Comments
Post a Comment