
VB如何获取某网页中“确定”按钮的单击事件?急!
打开一网页,向页面上的好几个文本框中输入数据,然后点击页面上的“确定”按钮。(页面上有好几个不同功能的按钮)问:当“确定”按钮按下时,VB怎样才能获得这一消息?并读取页面...
打开一网页,向页面上的好几个文本框中输入数据,然后点击页面上的“确定”按钮。(页面上有好几个不同功能的按钮)
问:当“确定”按钮按下时,VB怎样才能获得这一消息?并读取页面上的文本框及表格中的数据保存到数据库。(其它元素的事件又是怎样获得的?),请高手详细讲讲并给段代码。
谢谢!!!
新年快乐!!!
另:如果网页在点了“确定”钮后弹出提示时,如何取得提示框信息。 展开
问:当“确定”按钮按下时,VB怎样才能获得这一消息?并读取页面上的文本框及表格中的数据保存到数据库。(其它元素的事件又是怎样获得的?),请高手详细讲讲并给段代码。
谢谢!!!
新年快乐!!!
另:如果网页在点了“确定”钮后弹出提示时,如何取得提示框信息。 展开
展开全部
下面的html代码演示了VBscript获取确定按钮的单击事件:
<html>
<head>
<title>100以内的加减法运算</title>
<script language="vbscript">
function js()
dim sum,i
sum=0
if document.forms(0).t1.value=document.forms(0).h1.value then
sum=sum+10
end if
if document.forms(0).t2.value=document.forms(0).h2.value then
sum=sum+10
end if
if document.forms(0).t3.value=document.forms(0).h3.value then
sum=sum+10
end if
if document.forms(0).t4.value=document.forms(0).h4.value then
sum=sum+10
end if
if document.forms(0).t5.value=document.forms(0).h5.value then
sum=sum+10
end if
if document.forms(0).t6.value=document.forms(0).h6.value then
sum=sum+10
end if
if document.forms(0).t7.value=document.forms(0).h7.value then
sum=sum+10
end if
if document.forms(0).t8.value=document.forms(0).h8.value then
sum=sum+10
end if
if document.forms(0).t9.value=document.forms(0).h9.value then
sum=sum+10
end if
if document.forms(0).t10.value=document.forms(0).h10.value then
sum=sum+10
end if
document.write("你的成绩是" & sum & "分")
end function
</script>
</head>
<body>
<h1>小学二年级作业</h1><h4>100以内的加减法运算</h4><hr />
<form name="sj" id="sj1">
<script language="vbscript">
dim a,b
for i=1 to 10
randomize
a=int(rnd()*99)+1
b=int(rnd()*99)+1
document.write(i&". " & a & "+" & b & "=")
document.write("<input type=text name=t" & i & ">")
document.write("<input type=hidden name=h" & i & " value=" & a+b & "></p>")
next
</script>
<input type="button" value="确定" onclick="js()" />
</form>
</body>
</html>
<html>
<head>
<title>100以内的加减法运算</title>
<script language="vbscript">
function js()
dim sum,i
sum=0
if document.forms(0).t1.value=document.forms(0).h1.value then
sum=sum+10
end if
if document.forms(0).t2.value=document.forms(0).h2.value then
sum=sum+10
end if
if document.forms(0).t3.value=document.forms(0).h3.value then
sum=sum+10
end if
if document.forms(0).t4.value=document.forms(0).h4.value then
sum=sum+10
end if
if document.forms(0).t5.value=document.forms(0).h5.value then
sum=sum+10
end if
if document.forms(0).t6.value=document.forms(0).h6.value then
sum=sum+10
end if
if document.forms(0).t7.value=document.forms(0).h7.value then
sum=sum+10
end if
if document.forms(0).t8.value=document.forms(0).h8.value then
sum=sum+10
end if
if document.forms(0).t9.value=document.forms(0).h9.value then
sum=sum+10
end if
if document.forms(0).t10.value=document.forms(0).h10.value then
sum=sum+10
end if
document.write("你的成绩是" & sum & "分")
end function
</script>
</head>
<body>
<h1>小学二年级作业</h1><h4>100以内的加减法运算</h4><hr />
<form name="sj" id="sj1">
<script language="vbscript">
dim a,b
for i=1 to 10
randomize
a=int(rnd()*99)+1
b=int(rnd()*99)+1
document.write(i&". " & a & "+" & b & "=")
document.write("<input type=text name=t" & i & ">")
document.write("<input type=hidden name=h" & i & " value=" & a+b & "></p>")
next
</script>
<input type="button" value="确定" onclick="js()" />
</form>
</body>
</html>
追问
可能您的回答与我的问题正好相反:
我是想用VB监视一个特定的网页,当网页中的某个按钮被按下时,VB程序发生动作,读取网页中的文本框或表格中的内容保存在本地电脑中数据库中。不是用VB去点击网页中的按钮。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
这个可以 加我百度HI 我演示给你看
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询