使用JAVASCRIPT控制,IFAME的内容,从而使用投票点击等功能
在一个HTML可以插入一下IFAME,通过JAVSCRIPT控制IFAME的内容的动态变化提高等操作,使用一个自动操作功能,
这个举一个YAHOO投票的例子,YAHOO投票有一个限制,一个IP地址最多允许使用10个雅虎ID,
这样必需通自动断拨号.断拨号代码在http://www.cnblogs.com/edobnet/archive/2006/08/06/469200.html
代码如下:
这个举一个YAHOO投票的例子,YAHOO投票有一个限制,一个IP地址最多允许使用10个雅虎ID,
这样必需通自动断拨号.断拨号代码在http://www.cnblogs.com/edobnet/archive/2006/08/06/469200.html
代码如下:
<%@ Page language="c#" Codebehind="WebForm1.aspx.cs" AutoEventWireup="false" Inherits="test2.WebForm1" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>WebForm1</title>
<META content="Microsoft Visual Studio .NET 7.1" name=GENERATOR>
<META content=C# name=CODE_LANGUAGE>
<META content=JavaScript name=vs_defaultClientScript>
<META content=http://schemas.microsoft.com/intellisense/ie5
name=vs_targetSchema>
</HEAD>
<BODY onload=onL() MS_POSITIONING="GridLayout">
<FORM id=Form1 method=post runat="server"><TEXTAREA id=username style="WIDTH: 872px; HEIGHT: 56px" rows=3 cols=106><% =Request.QueryString["userName"].ToString()%></TEXTAREA>
<OBJECT id=dialObject style="DISPLAY: none"
data=data:application/x-oleobject;base64,IGkzJfkDzxGP0ACqAGhvEzwhRE9DVFlQRSBIVE1MIFBVQkxJQyAiLS8vVzNDLy9EVEQgSFRNTCA0LjAgVHJhbnNpdGlvbmFsLy9FTiI+DQo8SFRNTD48SEVBRD4NCjxNRVRBIGh0dHAtZXF1aXY9Q29udGVudC1UeXBlIGNvbnRlbnQ9InRleHQvaHRtbDsgY2hhcnNldD1nYjIzMTIiPg0KPE1FVEEgY29udGVudD0iTVNIVE1MIDYuMDAuMzc5MC4yNzA2IiBuYW1lPUdFTkVSQVRPUj48L0hFQUQ+DQo8Qk9EWT4NCjxQPiZuYnNwOzwvUD48L0JPRFk+PC9IVE1MPg0K
classid=http:DialControl.dll#DialControl.UserControl1
VIEWASTEXT>
</OBJECT>
参数(单位毫秒),开始放先拨号,拨号时间<INPUT id=vdail type=text value=10000>
载入登入页时间<INPUT id=vlogin type=text value=2000> 登入时间<INPUT id=vlogined type=text
value=8000> 退出时间<INPUT id=vloginout type=text value=2000> <IFRAME
id=Mframe
style="Z-INDEX: 101; LEFT: 16px; WIDTH: 100%; POSITION: absolute; TOP: 120px; HEIGHT: 76.84%"
name=Mframe src="" frameBorder=0 width="100%" scrolling=auto
height="100%">
</IFRAME></FORM>
<SCRIPT>
var arr = new Array();;
var i = 0;
var max = 0;
function onL()
{
var scrWidth = screen.availWidth;
var scrHeight = screen.availHeight;
window.moveTo(0, 0);
window.focus();
window.resizeTo(scrWidth, scrHeight);
startdo();
}
function startdo()
{
arr = document.all("username").value.split(",");
max = arr.length;
doNext();
}
function dail()
{
//document.all("dialObject").unAndDial();
//document.all("Mframe").src = 'dail.aspx';
}
function doNext()
{
fload(arr[i]);
}
function fload(name)
{
document.all("Mframe").src = "2.htm";
setTimeout("doi('"+name+"')", document.all('vlogin').value);
}
function doi(name)
{
displayMsg();
document.cookie = null;
Mframe.document.all("login").value = name;
Mframe.document.all("passwd").value = "<%=Request.QueryString["pass"].ToString()%>";
Mframe.document.all("btnSubmit").click();
//document.all("Mframe").onload = loginOut;
setTimeout('loginInit()', document.all('vlogined').value)
}
function loginInit()
{
document.all("Mframe").src = "http://bulo.cn.yahoo.com/blog/tip_ok.php?candidate=510522197910120253&return=1&start=1";
setTimeout('loginOut()', 4000);
}
function loginOut()
{
document.all("Mframe").src = "http://edit.bjs.yahoo.com/config/login?logout=1&.intl=cn&.direct=1&.done=http%3A%2F%2Fbulo.cn.yahoo.com%2Fblog%2Ftop108.php";
i++;
if(i<max)
setTimeout('doNext()', document.all('vloginout').value);
else
window.status = "完成";
}
function displayMsg()
{
window.status = "记数:"+i+"操作用户:"+arr[i];
}
</SCRIPT>
</BODY>
</HTML>
如果理解有问题,请通过EMAIL联系.<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>WebForm1</title>
<META content="Microsoft Visual Studio .NET 7.1" name=GENERATOR>
<META content=C# name=CODE_LANGUAGE>
<META content=JavaScript name=vs_defaultClientScript>
<META content=http://schemas.microsoft.com/intellisense/ie5
name=vs_targetSchema>
</HEAD>
<BODY onload=onL() MS_POSITIONING="GridLayout">
<FORM id=Form1 method=post runat="server"><TEXTAREA id=username style="WIDTH: 872px; HEIGHT: 56px" rows=3 cols=106><% =Request.QueryString["userName"].ToString()%></TEXTAREA>
<OBJECT id=dialObject style="DISPLAY: none"
data=data:application/x-oleobject;base64,IGkzJfkDzxGP0ACqAGhvEzwhRE9DVFlQRSBIVE1MIFBVQkxJQyAiLS8vVzNDLy9EVEQgSFRNTCA0LjAgVHJhbnNpdGlvbmFsLy9FTiI+DQo8SFRNTD48SEVBRD4NCjxNRVRBIGh0dHAtZXF1aXY9Q29udGVudC1UeXBlIGNvbnRlbnQ9InRleHQvaHRtbDsgY2hhcnNldD1nYjIzMTIiPg0KPE1FVEEgY29udGVudD0iTVNIVE1MIDYuMDAuMzc5MC4yNzA2IiBuYW1lPUdFTkVSQVRPUj48L0hFQUQ+DQo8Qk9EWT4NCjxQPiZuYnNwOzwvUD48L0JPRFk+PC9IVE1MPg0K
classid=http:DialControl.dll#DialControl.UserControl1
VIEWASTEXT>
</OBJECT>
参数(单位毫秒),开始放先拨号,拨号时间<INPUT id=vdail type=text value=10000>
载入登入页时间<INPUT id=vlogin type=text value=2000> 登入时间<INPUT id=vlogined type=text
value=8000> 退出时间<INPUT id=vloginout type=text value=2000> <IFRAME
id=Mframe
style="Z-INDEX: 101; LEFT: 16px; WIDTH: 100%; POSITION: absolute; TOP: 120px; HEIGHT: 76.84%"
name=Mframe src="" frameBorder=0 width="100%" scrolling=auto
height="100%">
</IFRAME></FORM>
<SCRIPT>
var arr = new Array();;
var i = 0;
var max = 0;
function onL()
{
var scrWidth = screen.availWidth;
var scrHeight = screen.availHeight;
window.moveTo(0, 0);
window.focus();
window.resizeTo(scrWidth, scrHeight);
startdo();
}
function startdo()
{
arr = document.all("username").value.split(",");
max = arr.length;
doNext();
}
function dail()
{
//document.all("dialObject").unAndDial();
//document.all("Mframe").src = 'dail.aspx';
}
function doNext()
{
fload(arr[i]);
}
function fload(name)
{
document.all("Mframe").src = "2.htm";
setTimeout("doi('"+name+"')", document.all('vlogin').value);
}
function doi(name)
{
displayMsg();
document.cookie = null;
Mframe.document.all("login").value = name;
Mframe.document.all("passwd").value = "<%=Request.QueryString["pass"].ToString()%>";
Mframe.document.all("btnSubmit").click();
//document.all("Mframe").onload = loginOut;
setTimeout('loginInit()', document.all('vlogined').value)
}
function loginInit()
{
document.all("Mframe").src = "http://bulo.cn.yahoo.com/blog/tip_ok.php?candidate=510522197910120253&return=1&start=1";
setTimeout('loginOut()', 4000);
}
function loginOut()
{
document.all("Mframe").src = "http://edit.bjs.yahoo.com/config/login?logout=1&.intl=cn&.direct=1&.done=http%3A%2F%2Fbulo.cn.yahoo.com%2Fblog%2Ftop108.php";
i++;
if(i<max)
setTimeout('doNext()', document.all('vloginout').value);
else
window.status = "完成";
}
function displayMsg()
{
window.status = "记数:"+i+"操作用户:"+arr[i];
}
</SCRIPT>
</BODY>
</HTML>