在按钮单击事件中用Text1=WebBrowser1.Document.body.innerText,获取网页信息,对于获取不同网页时候

在按钮单击事件中用Text1=WebBrowser1.Document.body.innerText,获取网页信息,对于获取不同网页时候,第1张

看不见你的报错信息

只能假设下了,如果你用的是frameset,需要访问其他frame的网页可以使用以下:

text1=selfparentframes["otherPageName"]documentbodyinnerText;

HTML Button onclick 事件汇总

<input onclick="documentallWebBrowserExecWB(1,1)" type="button" value="打开" name="Button1">

<input onclick="documentallWebBrowserExecWB(4,1)" type="button" value="另存为" name="Button2">

<input onclick="documentallWebBrowserExecWB(10,1)" type="button" value="属性" name="Button3">

<input onclick="documentallWebBrowserExecWB(6,1)" type="button" value="打印" name="Button">

<input onclick="documentallWebBrowserExecWB(8,1)" type="button" value="页面设置" name="Button4">

<input onclick="windowlocationreload()" type="button" value="刷新" name="refresh">

<input onClick="windowexternalImportExportFavorites(true,'');" type="button" value="导入收藏夹" name="Button5">

<input onClick="windowexternalImportExportFavorites(false,'');" type="button" value="导出收藏夹" name="Button32">

<input onClick="windowexternalAddFavorite(locationhref, documenttitle)" type="button" value="加入收藏夹" name="Button22">

<input onClick="windowexternalShowBrowserUI('OrganizeFavorites', null)" type="button" value="整理收藏夹" name="Submit2">

<input onclick='windowlocation="view-source:" + windowlocationhref' type="button" value="查看源文件" name="Button7">

<input onClick="windowexternalShowBrowserUI('LanguageDialog', null)" type="button" value="语言设置" name="Button6">

<input onClick="documentexecCommand('Cut')" type="button" value="剪切">

<input onClick="documentexecCommand('Copy')" type="button" value="拷贝">

<input onClick="documentexecCommand('Paste')" type="button" value="粘贴">

<input onClick="documentexecCommand('Undo')" type="button" value="撤消">

<input onClick="documentexecCommand('Delete')" type="button" value="删除">

<input onClick="documentexecCommand('Bold')" type="button" value="黑体">

<input onClick="documentexecCommand('Italic')" type="button" value="斜体">

<input onClick="documentexecCommand('Underline')" type="button" value="下划线">

<input onClick="documentexecCommand('stop')" type="button" value="停止">

<input onClick="documentexecCommand('SaveAs')" type="button" value="保存">

<input onClick="documentexecCommand('Saveas',false,'c:\\Autoruninf')" type="button" value="另存为">

<input onClick="documentexecCommand('FontName',false,fn)" type="button" value="字体">

<input onClick="documentexecCommand('FontSize',false,fs)" type="button" value="字体大小">

<input onClick="documentexecCommand('refresh',false,0)" type="button" value="刷新">

<input onclick="windowlocationreload()" type="button" value="刷新">

<input onclick="historygo(1)" type="button" value="前进">

<input onclick="historygo(-1)" type="button" value="后退">

<input onclick="historyforward()" type="button" value="前进">

<input onclick="historyback()" type="button" value="后退">

<input type="button" value="d出固定窗口" onClick="javascript:windowopen('#','','scrollbars=yes,width=600,height=200')" >

<input type="button" value="没有提示关闭" onclick="windowopener=null;windowclose();" />

<input type="button" value="点击进入另一页面" onclick="windowlocationhref=''" />

<input type="button" value="返回上一页" onclick="javascript:historygo(-1);" />

这个 简单 用计时器就可以的

SystemWindowsThreadingDispatcherTimer v_DispatcherTimer = new SystemWindowsThreadingDispatcherTimer();

for(int i =0;i<要循环的次数;i++)

{

v_DispatcherTimerTick += v_DispatcherTimerEvent;

v_DispatcherTimerInterval = TimeSpanFromSeconds(01);//每次执行的时间

v_DispatcherTimerStart();

}

void v_DispatcherTimerEvent(object sender, EventArgs e)

{

这里调用你要单击的事件

v_DispatcherTimerTick -= v_DispatcherTimerEvent;

v_DispatcherTimerStop();

}

//主要思路就是这个 其他代码你自己写

按钮加一个onclick事件就可以了,比如:

<input type=button name=sample onclick='javascript:alert("tjoy7d");' value='click me'>

onclick中可以写一些javascript或者别的脚本程序的函数。

<input type="button" name="n1" value="b1" onclick="test(this);">

<input type="button" name="n2" value="b2" onclick="test(this);">

<input type="button" name="n3" value="b3" onclick="test(this);">

<input type="button" name="n4" value="b4" onclick="test(this);">

<script>

function test(t)

{

alert('你点击的是'+tvalue+'按钮');

}

</script>

以上就是关于在按钮单击事件中用Text1=WebBrowser1.Document.body.innerText,获取网页信息,对于获取不同网页时候全部的内容,包括:在按钮单击事件中用Text1=WebBrowser1.Document.body.innerText,获取网页信息,对于获取不同网页时候、HTML控件<button>的点击事件怎么用、如何在网页中实现按钮点击实现循环事件响应等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/10157430.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-05
下一篇 2023-05-05

发表评论

登录后才能评论

评论列表(0条)

保存