在https中阻止网站

时间:2012-09-15 01:51:53

标签: c# https

此代码会阻止该网站:http://google.com或plus.google.com,但https://google.com不起作用

e.Cancel = e.Url.Host.Contains("google");

1 个答案:

答案 0 :(得分:2)

private void webBrowser1_Navigating(object sender, WebBrowserNavigatingEventArgs e)
 { 
    e.Cancel = e.Url.ToString().Contains("google"); 
 }