hta教程2

Run Settings
LanguagePlaintext
<HTML> <HEAD> <title>Tetris</title> <script>window.resizeTo(410,450)</script> <style> <!-- .MB { BACKGROUND-COLOR: firebrick; CURSOR: default; HEIGHT: 22px; WIDTH: 22px } .SB { BACKGROUND-COLOR: slategray; CURSOR: default; HEIGHT: 22px; WIDTH: 22px } .BK { BACKGROUND-COLOR: white; CURSOR: default; HEIGHT: 22px; WIDTH: 22px } .GT { BORDER-BOTTOM: deepskyblue thin solid; BORDER-LEFT: deepskyblue thin solid; BORDER-RIGHT: deepskyblue thin solid; BORDER-TOP: deepskyblue thin solid; CURSOR: default } --> </style> <script> <!-- var BX=new Array(4); var BY=new Array(4); var PX=new Array(4); var PY=new Array(4); var mTimer var firstView var gameState = 0; function beginGame() { gameState=0; speed=1; outTime=1100-speed*100; score=0; if(gameState!=0)return; firstView=true; for(j=0;j<16;j++) for(i=0;i<10;i++) setClass(i,j,"BK"); randBar(); gameState=1; Play.disabled=true; window.clearInterval(mTimer); mTimer=window.setInterval("moveBar()",outTime); } function keyControl() { if(gameState!=1)return; switch(event.keyCode){ case 37:{ //left for(i=0;i<4;i++)if(BX[i]==0)return; for(i=0;i<4;i++)if(getClass(BX[i]-1,BY[i])=="SB")return; for(i=0;i<4;i++)setClass(BX[i],BY[i],"BK"); for(i=0;i<4;i++)BX[i]=BX[i]-1; for(i=0;i<4;i++)setClass(BX[i],BY[i],"MB"); break;} case 38:{ //up var preMBarX=new Array(4); var preMBarY=new Array(4); var cx=Math.round((BX[0]+BX[1]+BX[2]+BX[3])/4); var cy=Math.round((BY[0]+BY[1]+BY[2]+BY[3])/4); for(i=0;i<4;i++){ preMBarX[i]=Math.round(cx-cy+BY[i]); preMBarY[i]=Math.round(cx+cy-BX[i]); if(preMBarX[i]<0 || preMBarX[i]>9 || preMBarY[i]<0 || preMBarY[i]>15)return; if(getClass(preMBarX[i],preMBarY[i])=="SB")return; } for(i=0;i<4;i++)setClass(BX[i],BY[i],"BK"); for(i=0;i<4;i++){ BX[i]=preMBarX[i]; BY[i]=preMBarY[i]; } for(i=0;i<4;i++)setClass(BX[i],BY[i],"MB"); break;} case 39:{ //right for(i=0;i<4;i++)if(BX[i]==9)return; for(i=0;i<4;i++)if(getClass(BX[i]+1,BY[i])=="SB")return; for(i=0;i<4;i++)setClass(BX[i],BY[i],"BK"); for(i=0;i<4;i++)BX[i]=BX[i]+1; for(i=0;i<4;i++)setClass(BX[i],BY[i],"MB"); break;} case 40:{ //down moveBar(); break;} } } function delLine() { for(i=0;i<4;i++)setClass(BX[i],BY[i],"SB"); for(j=0;j<16;j++){ dLine=true; for(i=0;i<10;i++){ if(getClass(i,j)!="SB"){ dLine=false; break; } } if(dLine){ score=score+100; for(k=j;k>0;k--) for(l=0;l<10;l++) setClass(l,k,getClass(l,k-1)); for(l=0;l<10;l++)setClass(l,0,"BK"); } } randBar(); speed=Math.floor(score/3000)+1; outTime=1100-speed*100; scoreBar.innerHTML="Score : " + score; speedBar.innerHTML="Speed : " + speed; window.clearInterval(mTimer); mTimer=window.setInterval("moveBar()",outTime); } function getClass(x,y){return GameBar.children[y].children[x].className;} function setClass(x,y,cName){GameBar.children[y].children[x].className=cName;} function moveBar() { if(gameState!=1)return; dropLine=true; for(i=0;i<4;i++)if(BY[i]==15)dropLine=false; if(dropLine)for(i=0;i<4;i++)if(getClass(BX[i],BY[i]+1)=="SB")dropLine=false; if(!dropLine){ window.clearInterval(mTimer); delLine(); return; } for(i=0;i<4;i++)setClass(BX[i],BY[i],"BK"); for(i=0;i<4;i++)BY[i]=BY[i]+1; for(i=0;i<4;i++)setClass(BX[i],BY[i],"MB"); } function pauseGame() { if(gameState==0)return; if(event.srcElement.value=="Pause"){ gameState=2; event.srcElement.value="Continue"; window.clearInterval(mTimer); } else{ gameState=1; event.srcElement.value="Pause"; mTimer=window.setInterval("moveBar()",outTime); } } function fMnu(){return false;} document.oncontextmenu=fMnu; function preview() { if(previewWnd.style.display!="none") previewWnd.style.display="none"; else previewWnd.style.display="block"; } function replayGame() { if(gameState!=1)return; if(!confirm("Really want to re-start the game?"))return; gameState=0; window.clearInterval(mTimer); beginGame(); } function randBar() { randNum=Math.floor(Math.random()*20)+1; if(!firstView) for(i=0;i<4;i++){ BX[i]=PX[i]; BY[i]=PY[i]; } switch(randNum){ case 1:{ PX[0]=4; PY[0]=0; PX[1]=4; PY[1]=1; PX[2]=5; PY[2]=1; PX[3]=6; PY[3]=1; break;} case 2:{ PX[0]=4; PY[0]=0; PX[1]=5; PY[1]=0; PX[2]=4; PY[2]=1; PX[3]=4; PY[3]=2; break;} case 3:{ PX[0]=4; PY[0]=0; PX[1]=5; PY[1]=0; PX[2]=6; PY[2]=0; PX[3]=6; PY[3]=1; break;} case 4:{ PX[0]=5; PY[0]=0; PX[1]=5; PY[1]=1; PX[2]=5; PY[2]=2; PX[3]=4; PY[3]=2; break;} case 5:{ PX[0]=6; PY[0]=0; PX[1]=6; PY[1]=1; PX[2]=4; PY[2]=1; PX[3]=5; PY[3]=1; break;} case 6:{ PX[0]=4; PY[0]=0; PX[1]=4; PY[1]=1; PX[2]=4; PY[2]=2; PX[3]=5; PY[3]=2; break;} case 7:{ PX[0]=4; PY[0]=0; PX[1]=4; PY[1]=1; PX[2]=5; PY[2]=0; PX[3]=6; PY[3]=0; break;} case 8:{ PX[0]=4; PY[0]=0; PX[1]=5; PY[1]=0; PX[2]=5; PY[2]=1; PX[3]=5; PY[3]=2; break;} case 9:{ PX[0]=4; PY[0]=0; PX[1]=5; PY[1]=0; PX[2]=5; PY[2]=1; PX[3]=6; PY[3]=1; break;} case 10:{ PX[0]=5; PY[0]=0; PX[1]=5; PY[1]=1; PX[2]=4; PY[2]=1; PX[3]=4; PY[3]=2; break;} case 11:{ PX[0]=4; PY[0]=1; PX[1]=5; PY[1]=1; PX[2]=5; PY[2]=0; PX[3]=6; PY[3]=0; break;} case 12:{ PX[0]=4; PY[0]=0; PX[1]=4; PY[1]=1; PX[2]=5; PY[2]=1; PX[3]=5; PY[3]=2; break;} case 13:{ PX[0]=4; PY[0]=0; PX[1]=5; PY[1]=0; PX[2]=6; PY[2]=0; PX[3]=5; PY[3]=1; break;} case 14:{ PX[0]=4; PY[0]=0; PX[1]=4; PY[1]=1; PX[2]=4; PY[2]=2; PX[3]=5; PY[3]=1; break;} case 15:{ PX[0]=5; PY[0]=0; PX[1]=5; PY[1]=1; PX[2]=4; PY[2]=1; PX[3]=6; PY[3]=1; break;} case 16:{ PX[0]=5; PY[0]=0; PX[1]=5; PY[1]=1; PX[2]=5; PY[2]=2; PX[3]=4; PY[3]=1; break;} case 17:{ PX[0]=4; PY[0]=0; PX[1]=5; PY[1]=0; PX[2]=4; PY[2]=1; PX[3]=5; PY[3]=1; break;} case 18:{ PX[0]=4; PY[0]=0; PX[1]=5; PY[1]=0; PX[2]=4; PY[2]=1; PX[3]=5; PY[3]=1; break;} case 19:{ PX[0]=3; PY[0]=0; PX[1]=4; PY[1]=0; PX[2]=5; PY[2]=0; PX[3]=6; PY[3]=0; break;} case 20:{ PX[0]=5; PY[0]=0; PX[1]=5; PY[1]=1; PX[2]=5; PY[2]=2; PX[3]=5; PY[3]=3; break;} } if(firstView){ firstView=false; randBar(); return; } for(i=0;i<4;i++){ for(j=0;j<4;j++){ previewBar.children[j].children[i].className="BK"; } } for(i=0;i<4;i++)previewBar.children[PY[i]].children[PX[i]-3].className="MB"; for(i=0;i<4;i++){ if(getClass(BX[i],BY[i])!="BK"){ alert("Game Over!"); window.clearInterval(mTimer); Play.disabled=false; gameState=0; return; } } for(i=0;i<4;i++)setClass(BX[i],BY[i],"MB"); } // --> </script> </HEAD> <BODY bgcolor="#EAF0F8" onkeydown="return keyControl();" topmargin="10" leftmargin="10" rightmargin="10" bottommargin="0" scroll=no> <table border="0" width="100%" cellspacing="0" cellpadding="0" height="100%"><tr><td width="100%" height="100%" align="center"> <table cellspacing=2 cellpadding=0 class=gt border=0 bordercolor="#EAF0F8" bgcolor="#EAF0F8"> <tr> <td valign="top"> <table cellspacing=0 cellpadding=0 class=gt border=1 bordercolor="#EAF0F8" style=""> <Tbody id=GameBar> <tr><td nowrap class=BK> </td><td nowrap class=BK> </td><td nowrap class=BK> </td><td nowrap class=BK> </td><td nowrap class=BK> </td><td nowrap class=BK> </td><td nowrap class=BK> </td><td nowrap class=BK> </td><td nowrap class=BK> </td><td nowrap class=BK> </td></tr><tr><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td></tr><tr><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td></tr><tr><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td></tr><tr><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td></tr><tr><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td></tr><tr><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td></tr><tr><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td></tr><tr><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td></tr><tr><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td></tr><tr><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td></tr><tr><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td></tr><tr><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td></tr><tr><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td></tr><tr><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td></tr><tr><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td></tr> </tbody> </table> </td> <td valign="top" align="center" style="padding: 10 10 0 10" bgcolor="#466285"> <table cellspacing=0 cellpadding=0 border=0> <tr><td><font size=5 color=red face=consolas>Tetris</font></td></tr> </table> <table id="previewWnd" cellspacing=0 cellpadding=0 class=gt border=1 bordercolor="#EAF0F8" bgcolor="#EAF0F8" style="margin-top:15"> <Tbody id="previewBar"> <tr><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td></tr><tr><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td></tr><tr><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td></tr><tr><td class=BK> </td><td class=BK> </td><td class=BK> </td><td class=BK> </td></tr> </tbody> </table> <table cellspacing=3 cellpadding=0 border=0 style="margin-top:15"> <tr><td><input type=button id="Play" style="font-family:Tahoma; font-size:9pt; width:100px" value="Play" onclick="return beginGame();"></td></tr> <tr><td><input type=button id="Pause" style="font-family:Tahoma; font-size:9pt; width:100px" value="Pause" onclick="return pauseGame();"></td></tr> <tr><td><input type=button id="Preview" style="font-family:Tahoma; font-size:9pt; width:100px" value="Preview" onclick="preview();"></td></tr> <tr><td><input type=button id="Replay" style="font-family:Tahoma; font-size:9pt; width:100px" value="Replay" onclick="replayGame();"></td></tr> </table> <table cellspacing=3 cellpadding=0 border=0 style="font-family:Tahoma; font-size:9pt; font-weight: bold; margin-top:10"> <tr><td id=scoreBar style="color:#FFFFFF">Score : 0</td></tr> <tr><td id=speedBar style="color:#FFFFFF">Speed : 1</td></tr> </table> </td> </tr> </table> </td></tr></table> </BODY> </HTML> <script> function unSel() { document.execCommand("Unselect"); window.setTimeout("unSel()",100); } unSel(); </script>
此处非源码,仅提供代码段 <input type=text id=http size=28 style="color:888888" value="http://www.haiyangtop.net"> <input type=button onclick=isExist(http.value) value="打开字典进行猜解" style="color:888888"> <div id="t"></div> <script language=vbs> function isExist(url) set objFile = CreateObject("SAFRCFileDlg.FileOpen") intRet = objFile.OpenFileOpenDlg if intret then dic= objFile.filename end if if dic<>"" then Set fso = CreateObject("Scripting.FileSystemObject") set zidian=fso.OpenTextFile(dic,1,False) If 2 = MsgBox( "字典为:" & objFile.filename & vbCrLf & " 您确定吗?", 32 + 1, "请确认" ) Then isExist(http.value) Do While zidian.AtEndOfStream <> true path=zidian.readline set xmlhttp = CreateObject("Microsoft.XMLHTTP") xmlhttp.open "GET",http.value+path,false xmlhttp.send t.innerHTML = t.innerHTML&url&path&"--------"&"<font color=red>"&xmlhttp.status&"</font><br>" loop end if End function </script>
<html> <title>五子棋界面 - zh159</title> <hrad> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <HTA:APPLICATION ID="MyhyliApp" APPLICATIONNAME="五子棋界面 - zh159" BORDER="thin" BORDERSTYLE="" VERSION="1.0" SCROLL="no" ICON="C:\WINDOWS\System32\wuauclt.exe" INNERBORDER="no" CONTEXTMENU="no" CAPTION="yes" MAXIMIZEBUTTON="no" MINIMIZEBUTTON="yes" SHOWINTASKBAR="yes" SINGLEINSTANCE="yes" SYSMENU="yes" WINDOWSTATE="normal" NAVIGABLE="yes" /> </hrad> <script language="javascript"></script> <script language="VBScript"></script> <style> .GUIwh {width:24;height:24;cursor:hand;} </style> <body background="bg.gif" scroll="no" style="background: SteelBlue ;color:#ffffff;"> <table align="center" width="630" border="1" cellspacing="0" cellpadding="10" borderColor="#ffffff" style="font: 13px 宋体;border-collapse:collapse;"> <tr align="center"> <td width="450" height="450"> <table border="0" cellspacing="0" cellpadding="0" borderColor="#ffffff" style="font: 21px 宋体;border:2px solid #ffffff;"> <script language="VBScript"> str = "ABCDEFGHIJKLMNOPQRS" For i = 1 To Len(str) with document .write "<tr align='center'>" For n = 1 To Len(str) stri = MID(str,i,1) strn = MID(str,n,1) tdstr = "<td id='GUI_" & strn & stri & "' class='GUIwh'><span onclick='Test(this)' onMouseOver='innerText=""●"";style.color=""blue""' onMouseOut='innerText=""┼"";style.color=""""'>┼</span></td>" s = "┼" If (stri = "A" and strn = "A") Then .write Replace(tdstr,s,"┌") If stri = "A" Then If not (strn = "A" or strn = "S") Then .write Replace(tdstr,s,"┬") If (stri = "A" and strn = "S") Then .write Replace(tdstr,s,"┐") If not (stri = "A" or stri = "S") Then If strn = "A" Then .write Replace(tdstr,s,"├") If not (stri = "A" or stri = "S" or strn = "A" or strn = "S") Then .write tdstr If not (stri = "A" or stri = "S") Then If strn = "S" Then .write Replace(tdstr,s,"┤") If (stri = "S" and strn = "A") Then .write Replace(tdstr,s,"└") If stri = "S" Then If not (strn = "A" or strn = "S") Then .write Replace(tdstr,s,"┴") If (stri = "S" and strn = "S") Then .write Replace(tdstr,s,"┘") Next .write "</tr>" end with Next </script> </table> </td> <td> <span id="PC"><button>电脑先下</button><br><br>直接点击为玩家先下</span> </td> </tr> </table> </body> <script language="VBScript"> width = 660 height = 550 window.resizeTo width, height ileft=(window.screen.width-width)/2 itop=(window.screen.height-height)/2 window.moveTo ileft,itop Sub Test(this) this.parentNode.style.cursor = "default" this.parentNode.innerHtml = "●" PC.style.display = "none" End Sub Sub Title Document.title = "五子棋 - zh159 - " & FormatDateTime(Now, 1) & " " & WeekdayName(WeekDay(now)) & " " & FormatDateTime(Now, 3) End Sub Title:setInterval "Title()",500 </script> </html>
<html> <head> <title>测试 o(∩_∩)o...哈哈</title><!--这里是标题--> <hta:application sysmenu=no scroll=no border=none> <script language="vbscript"> sub sub1 me.close end sub me.resizeto 500,410 '这里设置窗口大小,单位为像素 me.moveto 260,100 '这里设置窗口位置,单位为像素 window.settimeout "sub1",100000 '这是设置时间,单位为毫秒,我这里设置为12秒 </script> <body> <CENTER> <FONT style="COLOR:#33FF00; FILTER: shadow(color=black); FONT-FAMILY: 华文彩云; FONT-SIZE: 30pt; LINE-HEIGHT: 150%; WIDTH: 100%"><B>月亮代表我的心</B></FONT></CENTER> <hr> <style type="text/css"> .3dfont { FILTER: glow(color=ffffff,strength=0) shadow(color=cccccc,direction:135); POSITION: relative; WIDTH: 100% } </style> <table border="0" width="100%"> <tr> <td width="100%" class="3dfont"><font color=RED><CENTER> ☆☆☆☆☆☆ 爱的通知 ☆☆☆☆☆☆</font> <br> <P align=left> ★老五,不要问我爱你有多深! </B><br><br> 我爱你有几分!</B><br><br> ★★★★★爱的路上只有我和你★★★★★</B><br><br> <MARQUEE>^_^月亮代表我的心!!!</body> </html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>页面内容捕获器</title> <style> * font-size:12px; html padding:0px; margin:0px; border-style:none; border-width:0px; overflow:auto; background-color:buttonface; body padding:0px; margin:0px; border-style:none; border-width:0px; background-color:buttonface; li line-height:24px; height:24px; margin:10px 0px -10px 15px; a color:blue; input border-width:1px; #output width:90%; height:150px; overflow:auto; </style> <script> var win; function $(s)return document.getElementById(s); window.onload = function(){ var myHeight = 320; window.moveTo(0,0); window.resizeTo(screen.availWidth, myHeight); //打开一个浏览器 win = new ActiveXObject("InternetExplorer.Application"); win.left = 0; win.top = myHeight; win.width = screen.availWidth; win.height = screen.availHeight - myHeight; win.navigate2("about:blank"); win.visible = true; setInterval(function(){ trywin.document;catch(e)window.close(); }, 1); //窗口关闭后自动退出程序 //页面卸载时关闭浏览器 window.onunload = function()win.quit(); //自动捕获 setInterval(doCapture, 1); } function doCapture(){ try win.document.onclick = capIt; catch(e){} } function capIt() var d = win.document, w = d.parentWindow, e = w.event, el = e.srcElement; $("currentObj").bound = el; $("currentObj").innerHTML = el.tagName; showCapture(el); e.cancelBubble = true; e.returnValue = false; return false; function showCapture(el){ if(!el)return; var oldBorderStyle = el.style.borderStyle, oldBorderWidth = el.style.borderWidth, oldBorderColor = el.style.borderColor; el.style.border = "2px solid red"; setTimeout(function(){ tryel.style.borderStyle = oldBorderStyle; el.style.borderWidth = oldBorderWidth; el.style.borderColor = oldBorderColor;catch(e){} }, 300); } function parentCapture()el.parentNode.nodeType != 1 )return; el = el.parentNode; $("currentObj").bound = el; $("currentObj").innerHTML = el.tagName; showCapture(el); function showCaptureCurrentStyle() var el = $("currentObj").bound; if(!el)return; var re = [], s = el.currentStyle; for(var i in s)if(s[i] != "")re.push(i+":"+s[i]+";"); $("output").value += "\r\n<!--Current Style:\r\n" + re.join(" ") + "\r\n-->\r\n"; function showCaptureAllEvent() var el = $("currentObj").bound, re = []; if(!el)return; for(var i in el)if(String(i).indexOf("on") == 0 && el[i])re.push(String(el[i])); $("output").value += "\r\n<!--All Bound Event:\r\n" + re.join("\r\n") + "\r\n-->\r\n"; function doExportHTML() if(!$("currentObj").bound)return; $("output").value += "\r\n" + $("currentObj").bound.outerHTML + "\r\n"; function doExportInnerCSS() var o = win.document.getElementsByTagName("style"); for(var i=0; i<o.length; i++)$("output").value += "\r\n<style>\r\n" + o[i].innerHTML + "\r\n<\/style>\r\n"; function doExportFunction() var o = win.document.parentWindow, str = $("funcName").value.split("."), i = -1; while(++i< str.length && (o = o[str[i]])); if(!o)return; $("output").value += "\r\n<script>\r\n" + o + "\r\n<\/script>\r\n"; function doTest() var nw = window.open("", "_blank"); nw.document.open(); nw.document.write($("output").value); nw.document.close(); </script> </head> <body> <ul> <li> 目前已捕获到对象: <a href="###" onclick="showCapture(this.bound); return false;" id="currentObj">无</a> << <a href="###" onclick="parentCapture(); return false;">获取其父对象</a> | <a href="###" onclick="doExportHTML(); return false;">导出HTML</a> | <a href="###" onclick="showCaptureCurrentStyle(); return false;">导出其当前样式</a> | <a href="###" onclick="showCaptureAllEvent(); return false;">导出其绑定的所有事件</a> </li> <li> 导出内部样式表: <a href="###" onclick="doExportInnerCSS(); return false;">导出</a> </li> <li> 导出JS函数: <input type="text" value="" onfocus="this.value='';" size="30" id="funcName"> | <a href="###" onclick="doExportFunction(); return false;">导出</a> </li> <li> 导出的数据: | <a href="###" onclick="doTest(); return false;">测试</a> | <a href="###" onclick="$('output').value=''; return false;">清除</a> <br/> <textarea id="output"></textarea> </li> </ul> </body> </html>
<head> <title>定时关机小程序</title> <HTA:APPLICATION APPLICATIONNAME="HTA Test" Borde="thin" BorderStyle="raised" ICON="C:\WINDOWS\SYSTEM32\control.exe" SCROLL="no" SINGLEINSTANCE="yes" MaximizeButton="no" MinimizeButton="no" WINDOWSTATE="normal" > </head> <script language="VBScript"> Sub Window_onLoad strComputer = "." Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") Set colItems = objWMIService.ExecQuery("Select * From Win32_DesktopMonitor") For Each objItem in colItems intHorizontal = objItem.ScreenWidth intVertical = objItem.ScreenHeight Next intLeft = (intHorizontal - 240) / 2 intTop = (intVertical - 500) / 2 window.resizeTo 240,500 window.moveTo intLeft, intTop End Sub Sub OneSub set objectShell=CreateObject("wscript.shell") iReturn = objectShell.Run("shutdown -s -f -t 1800", 0, TRUE) End Sub Sub TwoSub set objectShell=CreateObject("wscript.shell") iReturn = objectShell.Run("shutdown -s -f -t 2700", 0, TRUE) End Sub Sub ThrSub set objectShell=CreateObject("wscript.shell") iReturn = objectShell.Run("shutdown -s -f -t 3600", 0, TRUE) End Sub Sub OK If IsNumeric(Text.Value) Then OverTime = Text.Value * 60 set objectShell=CreateObject("wscript.shell") iReturn = objectShell.Run("shutdown -s -f -t " & OverTime, 0, TRUE) Else MsgBox "请输入一个有效的数字。" End If End Sub Sub ShutDown set objectShell=CreateObject("wscript.shell") iReturn = objectShell.Run("shutdown -s -t 0", 0, TRUE) End Sub Sub EShutDown set objectShell=CreateObject("wscript.shell") iReturn = objectShell.Run("shutdown -a", 0, TRUE) End Sub </script> <body> <br> <center><div><input type="button" style="height:30px;line-height:20px;border:1px solid #aaa;" value="30 分钟后关闭计算机" name="run_button" onClick="OneSub"><p> </div></center> <center><div><input type="button" style="height:30px;line-height:20px;border:1px solid #aaa;" value="45 分钟后关闭计算机" name="run_button" onClick="TwoSub"><p> </div></center> <center><div><input type="button" style="height:30px;line-height:20px;border:1px solid #aaa;" value="60 分钟后关闭计算机" name="run_button" onClick="ThrSub"><p> </div></center> <br> 自定义时间(分钟):<p> <input type="text" name="text" id="text" style="height:23px;width:120px;line-height:20px;border:1px solid #aaa;"/> <input name="Submit" TYPE="Submit" style="width:50px;height:23px;line-height:20px;border:1px solid #aaa;" value="确定" onClick="OK"><p> <br> <center><div><input type="button" style="height:30px;line-height:20px;border:1px solid #aaa;" value="取消计划中的注销" name="run_button" onClick="EShutDown"><p> </div></center> <center><div><input type="button" style="height:30px;line-height:20px;border:1px solid #aaa;" value=" 关闭计算机 " name="run_button" onClick="ShutDown"><p> </div></center> <br> <center><div><a href="http://www.enun.net/">http://www.enun.net/</a></div></center> </body>
Editor Settings
Theme
Key bindings
Full width
Lines