在 C# windows 窗体应用程序 webbrowser 中单击网页上的 .swf 按钮
我正在尝试单击 C# windows 窗体网络浏览器中的 shockwave flash 按钮。目前,在我的 Windows 窗体应用程序中,我登录网站并转到按钮所在的网页。然后,我想单击 Windows 窗体按钮,并让它单击 Flash 按钮 5 次,每次单击之间间隔约 15 秒。到目前为止,我一无所有,只是花了很多时间在谷歌上搜索,但一无所获。据我所知并尝试过,机制全部包含在button_2.swf中,我尝试调用网站上的javascript,但没有任何反应。在 swf 中,您需要“翻转”flash 按钮,然后“按”运行“gotoandplay(11)”,并且在某些时候最后会运行一些 xml 代码。是的,html 代码中有 no flash 脚本,但它无法正常工作,所以这是不可能的。该按钮的html代码如下:
<div id='button'>
<script type="text/javascript">
function disableButton() {
btn = document.getElementById('luckybutton');
btn.style.display = 'none';
btn_clicked = document.getElementById('luckybutton_clicked');
btn.style.display = 'block';
}
</script>
<div id='luckybutton' style="z-index:1">
<script language="javascript">
AC_FL_RunContent('codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0','width', '373','height', '373','src', '/images/buttons/','quality', 'high','pluginspage', 'http://www.macromedia.com/go/getflashplayer','align', 'middle','play', 'false','loop','true','scale','showall','wmode','transparent','devicefont','false','id', '','bgcolor', '#ddeef6','name', '','menu', 'true','allowFullScreen', 'false','allowScriptAccess','sameDomain','movie', '/images/buttons/button_2','salign', ''); //end AC code
</script>
<noscript>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="373" height="373" id="" align="middle" style="z-index:1">
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="false" />
<param name="movie" value="/images/buttons/button_2.swf" />
<param name="quality" value="high" /><param name="bgcolor" value="#ddeef6" />
<embed src="/images/buttons/.swf" quality="high" bgcolor="#ddeef6" width="373" height="373" name="" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
<!-- no_flash content -->
<a href="/button/push_the_button" data-method="post" onmousedown="disableButton();return false;" rel="nofollow"><img alt="Luckybutton" src="/images/slb/luckybutton.jpg?1286570555" /></a>
<!-- end no_flash content -->
</object>
</noscript>
</div>
<div id="luckybutton_clicked" style="display:none">
<img alt="Luckybutton" src="/images/slb/luckybutton.jpg?1286570555" />
</div>
</div>
I am trying to click on a shockwave flash button in my C# windows forms webbrowser. Currently in my windows forms application, I sign into the website and go the webpage where the button is. I want to then click on my windows form button, and have it click the flash button 5 times with about 15 seconds pause in between clicks. As of now, I have nothing, but a lot of hours of googling and getting nowhere. From what I can tell and have played around with, the mechanics is all wrapped up in the button_2.swf and I have tried to call the javascripts on the website but nothing happens. In the swf, you need to 'rollOver' the flash button and then 'press' to run 'gotoandplay(11)' and at some point there is some xml code running at the end. Yes there is the no flash script in the html code, but it doesnt work properly, so that is out of the question. The html code for the button is as follows:
<div id='button'>
<script type="text/javascript">
function disableButton() {
btn = document.getElementById('luckybutton');
btn.style.display = 'none';
btn_clicked = document.getElementById('luckybutton_clicked');
btn.style.display = 'block';
}
</script>
<div id='luckybutton' style="z-index:1">
<script language="javascript">
AC_FL_RunContent('codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0','width', '373','height', '373','src', '/images/buttons/','quality', 'high','pluginspage', 'http://www.macromedia.com/go/getflashplayer','align', 'middle','play', 'false','loop','true','scale','showall','wmode','transparent','devicefont','false','id', '','bgcolor', '#ddeef6','name', '','menu', 'true','allowFullScreen', 'false','allowScriptAccess','sameDomain','movie', '/images/buttons/button_2','salign', ''); //end AC code
</script>
<noscript>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="373" height="373" id="" align="middle" style="z-index:1">
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="false" />
<param name="movie" value="/images/buttons/button_2.swf" />
<param name="quality" value="high" /><param name="bgcolor" value="#ddeef6" />
<embed src="/images/buttons/.swf" quality="high" bgcolor="#ddeef6" width="373" height="373" name="" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
<!-- no_flash content -->
<a href="/button/push_the_button" data-method="post" onmousedown="disableButton();return false;" rel="nofollow"><img alt="Luckybutton" src="/images/slb/luckybutton.jpg?1286570555" /></a>
<!-- end no_flash content -->
</object>
</noscript>
</div>
<div id="luckybutton_clicked" style="display:none">
<img alt="Luckybutton" src="/images/slb/luckybutton.jpg?1286570555" />
</div>
</div>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
方式0:gotoandplay(11)可以用直接方式来做
if you have source of flash
way 1: Pass variable to SWF and in flash check value of variable
way 2: move mouse and click on button :D use
Moving mouse cursor programmatically
way 0: gotoandplay(11) can do with direct way
if you have source of flash
way 1: Pass variable to SWF and in flash check value of variable
way 2: move mouse and click on button :D use
Moving mouse cursor programmatically