[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖

[转贴] hta 实现的五子棋界面(转载)

保存为 五子棋.hta,运行即可看到效果
  1. <html>
  2. <title>五子棋界面 - zh159</title>
  3. <hrad>
  4. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  5. <HTA:APPLICATION
  6. ID="MyhyliApp"
  7. APPLICATIONNAME="五子棋界面 - zh159"
  8. BORDER="thin"
  9. BORDERSTYLE=""
  10. VERSION="1.0"
  11. SCROLL="no"
  12. ICON="C:\WINDOWS\System32\wuauclt.exe"
  13. INNERBORDER="no"
  14. CONTEXTMENU="no"
  15. CAPTION="yes"
  16. MAXIMIZEBUTTON="no"
  17. MINIMIZEBUTTON="yes"
  18. SHOWINTASKBAR="yes"
  19. SINGLEINSTANCE="yes"
  20. SYSMENU="yes"
  21. WINDOWSTATE="normal"
  22. NAVIGABLE="yes"
  23. />
  24. </hrad>
  25. <script language="javascript"></script>
  26. <script language="VBScript"></script>
  27. <style>
  28. .GUIwh {width:24;height:24;cursor:hand;}
  29. </style>
  30. <body background="bg.gif" scroll="no" style="background: SteelBlue ;color:#ffffff;">
  31. <table align="center" width="630" border="1" cellspacing="0" cellpadding="10" borderColor="#ffffff" style="font: 13px 宋体;border-collapse:collapse;">
  32.   <tr align="center">
  33.     <td width="450" height="450">
  34.       <table border="0" cellspacing="0" cellpadding="0" borderColor="#ffffff" style="font: 21px 宋体;border:2px solid #ffffff;">
  35.         <script language="VBScript">
  36.         str = "ABCDEFGHIJKLMNOPQRS"
  37.         For i = 1 To Len(str)
  38.                 with document
  39.                 .write "<tr align='center'>"
  40.                 For n = 1 To Len(str)
  41.                         stri = MID(str,i,1)
  42.                         strn = MID(str,n,1)
  43.                         tdstr = "<td id='GUI_" & strn & stri & "' class='GUIwh'><span onclick='Test(this)' onMouseOver='innerText=""●"";style.color=""blue""' onMouseOut='innerText=""┼"";style.color=""""'>┼</span></td>"
  44.                         s = "┼"
  45.                         If (stri = "A" and strn = "A") Then .write Replace(tdstr,s,"┌")
  46.                         If stri = "A" Then If not (strn = "A" or strn = "S") Then .write Replace(tdstr,s,"┬")
  47.                         If (stri = "A" and strn = "S") Then .write Replace(tdstr,s,"┐")
  48.                         If not (stri = "A" or stri = "S") Then If strn = "A" Then .write Replace(tdstr,s,"├")
  49.                         If not (stri = "A" or stri = "S" or strn = "A" or strn = "S") Then .write tdstr
  50.                         If not (stri = "A" or stri = "S") Then If strn = "S" Then .write Replace(tdstr,s,"┤")
  51.                        
  52.                         If (stri = "S" and strn = "A") Then .write Replace(tdstr,s,"└")
  53.                         If stri = "S" Then If not (strn = "A" or strn = "S") Then .write Replace(tdstr,s,"┴")
  54.                         If (stri = "S" and strn = "S") Then .write Replace(tdstr,s,"┘")
  55.                 Next
  56.                 .write "</tr>"
  57.                 end with
  58.         Next
  59.         </script>
  60.       </table>
  61.     </td>
  62.     <td>
  63.       <span id="PC"><button>电脑先下</button><br><br>直接点击为玩家先下</span>
  64.     </td>
  65.   </tr>
  66. </table>
  67. </body>
  68. <script language="VBScript">
  69.   width = 660
  70.   height = 550
  71.   window.resizeTo width, height
  72.   ileft=(window.screen.width-width)/2
  73.   itop=(window.screen.height-height)/2
  74.   window.moveTo ileft,itop
  75.         Sub Test(this)
  76. this.parentNode.style.cursor = "default"
  77. this.parentNode.innerHtml = "●"
  78. PC.style.display = "none"
  79.         End Sub
  80.         Sub Title
  81. Document.title = "五子棋 - zh159 - " & FormatDateTime(Now, 1) & "  " & WeekdayName(WeekDay(now)) & "  " & FormatDateTime(Now, 3)
  82.         End Sub
  83. Title:setInterval "Title()",500
  84. </script>
  85. </html>
复制代码

找不到出处,如果有哪位大神知道,烦请代为贴出来源,感谢...

TOP

返回列表