不允许弹出窗口

本文关键字:窗口 不允许 | 更新日期: 2023-09-27 18:05:38

我制作HttpWebRequest/HttpWebResponse,当我得到响应时我得到错误->

此网站的附加组件未能运行。在潜在冲突的Internet选项中单击"安全设置"。

我不能只按允许从网站弹出窗口,我需要编程,启用弹出窗口或添加注册表项到这个网站。

这里是我的代码

   string   postData += "userid=" + strUser + "&";
            postData += "numID=" + strUserId + "&";
            postData += "userPassword=" + strPass + "&";
            HttpWebRequest postRequest = (HttpWebRequest)WebRequest.Create(loginPostUrl);
            postRequest.CookieContainer = new CookieContainer();
            postRequest.CookieContainer = _cookies;
            postRequest.Method = WebRequestMethods.Http.Post;
            postRequest.UserAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:29.0) Gecko/20100101 Firefox/29.0";
            postRequest.AllowWriteStreamBuffering = true;
            postRequest.ProtocolVersion = HttpVersion.Version11;
            postRequest.AllowAutoRedirect = true;
            postRequest.ContentType = "application/x-www-form-urlencoded";

            byte[] byteArray = Encoding.ASCII.GetBytes(postData);
            postRequest.ContentLength = byteArray.Length;
            Stream newStream = postRequest.GetRequestStream(); //open connection
            newStream.Write(byteArray, 0, byteArray.Length); // Send the data.
            newStream.Close();
            HttpWebResponse postResponseAfterLogin = (HttpWebResponse)postRequest.GetResponse();

            //After inserting User and Password
            Stream streamResponseLoginForm = postResponseAfterLogin.GetResponseStream();
            StreamReader streamReadLoginForm = new StreamReader(streamResponseLoginForm);
            outString = streamReadLoginForm.ReadToEnd();//This is afer login btn pressed here we 

我试图登录WatIn

using (var browser = new IE("www.blabla.com")){

        browser.TextField(Find.ById("userID")).Value = strUser;
        browser.TextField(Find.ById("numID")).Value = strUserId;
        browser.TextField(Find.ById("userPassword")).Value = strPass;
        browser.Image(Find.ById("inputSend")).Click();
        Thread.Sleep(WaitTime+2000);
    }

This not work to。我看到这个弹出窗口IE不允许从网站www.blabla.com弹出窗口"

如何允许弹出从网站或和我的网站www.blabla.com"网站列表,允许弹出?

不允许弹出窗口

您必须进入internet选项->隐私->并取消勾选打开弹出窗口并保存

当您的Activex控件被安装时,您必须只通过此方法允许它们