需要一种对Firefox或任何其他浏览器弹出窗口执行自动确认的方法 [英] Need a way to perform auto confirm for firefox or any other browser popup's

查看:23
本文介绍了需要一种对Firefox或任何其他浏览器弹出窗口执行自动确认的方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一种方法可以自动确认弹出窗口.例如即时经由火狐删除文件此操作触发一个确认弹出时的选项是OK和Cancel.

Is there a way to auto confirm popup. For example i'm deleting file via firefox this operation triggers a confirmation popup when the options are ok and cancel.

在这种情况下,我需要自动单击确定"按钮.

In this case i need to click on ok button automatically.

推荐答案

找到了一种在C#中执行此操作的方法:

Found a way to do this in C#:

执行所需的操作(如删除),然后:

Perform the desired action (like delete) and then:

    SendKeys.SendWait("{ENTER}"); //in case if the focus was on ok button


    SendKeys.SendWait("{TAB}"); //in case if the focus was on cancel button
    SendKeys.SendWait("{ENTER}"); 

这篇关于需要一种对Firefox或任何其他浏览器弹出窗口执行自动确认的方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆