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

[原创] 汉字区位码查询[hta]

一个用来查询汉字区位码的小东西

源代码:
  1. <!--////////程序说明/////////====
  2. 程序名称:汉字区位码查询.hta
  3. 程序作者:youxi01
  4. 完成日期:2008-9-21
  5. <!--//////////样式////////////-->
  6. <HTA:APPLICATION
  7. SCROLL="no"
  8. INNERBORDER="no"
  9. SHOWINTASKBAR="yes"
  10. SINGLEINSTANCE="yes"
  11. />
  12. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  13. <style type="text/css">
  14. a:link {color: blue}
  15. a:visited {color: blue}
  16. body  {background: #EEEEEE}
  17. #table {border:none;width:100%;background: #EEEEEE;}
  18. #table td {border:1 solid  #BEBEBE ; height="180"; }
  19. .test {padding: 3px}
  20. .menuUp {
  21. border:1px solid  menu;
  22. height:20px;
  23. }
  24. .menuOver {
  25. padding-top:1px;
  26. border-left:1px solid buttonhighlight;
  27. border-top:1px solid buttonhighlight;
  28. border-right:1px solid buttonshadow;
  29. border-bottom:1px solid buttonshadow;
  30. }
  31. .menuDown {
  32. padding-top:1px;
  33. border-left:1px solid buttonshadow;
  34. border-top:1px solid buttonshadow;
  35. border-right:1px solid buttonhighlight;
  36. border-bottom:1px solid buttonhighlight;
  37. }
  38. </style>
  39. <SCRIPT Language="VBScript">
  40. Sub window_onload
  41. window.resizeTo 380,250
  42. ileft=(window.screen.width-380)/2
  43. itop=(window.screen.height-250)/2
  44. window.moveTo ileft,itop
  45. call query_onclick()
  46. End sub
  47. Function GetCode(str)    '///获取汉字的区位码
  48.     casc=asc(str)
  49.     if casc<0 then casc=casc+65535+1
  50.     if casc>255 then
  51. b2="0"&Right(((casc and 255)-160),2)
  52. b1=Right((int(casc/256)-160),2)
  53. GetCode=b1&Right(b2,2)
  54.     else
  55. GetCode=str
  56.     end if
  57. End Function
  58. Function query_onclick()
  59.     L=len(CN.value)
  60.     for i=1 to L
  61.         Tstr=mid(CN.value,i,1)
  62. if Tstr<>" " then
  63. Tstr="<font color=blue>"&Tstr&"</font>:<font color=green>"&GetCode(Tstr)&"</font>"
  64. Res=Res&Tstr&"</br>"
  65. end if
  66.     next
  67.     Result.innerHTML="查询结果:</br>"&Res
  68. End Function
  69. Function CN_onmouseOver()
  70. me.select
  71. End Function
  72. </SCRIPT>
  73. <title>汉字区位码查询</title>
  74. <body topmargin="2" rightmargin="0" leftmargin="0">
  75. <table id="table" cellpadding="8" cellspacing="5">
  76.     <tr>
  77.       <td width="40%" valign=top>输入汉字:
  78.       <div class="test"><input ID=CN type="text" value="在这里输入汉字" style="BACKGROUND-COLOR: peachpuff;color:#789" size=16></div>
  79.       <div class="test" align=center> <input type="button" ID=query value="点击查询" class="menuUp" onmouseover=me.className='menuOver' onmousedown=me.className='menuDown' onmouseout=me.className='menuUp'></div>
  80.       <div class="test"><fieldset>
  81.      <legend><font color=red>使用说明</font></legend>
  82.      <font size=3px;>1、只能查询GB2312汉字;</br>
  83.      2、可以同时查询多个汉字。</font>
  84.      </fieldset></div>
  85.       </td>
  86.       <td width="59%"><div id=Result style="overflow:auto;height=160">查询结果:</div></td>
  87.     </tr>
  88. </table>
  89. <div align="center">Code by <font color=red>youxi01</font>(2laoshi)
  90. <a href="http://www.2laoshi.cn" target="blank">访问blog</a>
  91. </div>
  92. </body>
复制代码
1

评分人数

    • Batcher: 感谢分享PB + 10 技术 + 1

返回列表