如何在hta中显示alt + 0160(无空格)?

时间:2016-07-27 17:17:23

标签: unicode vbscript hta

我正在做转换器角色。在任何时候你都需要显示alt + 0160字符,它在另一个textarea中获得空间属性。如何在另一个textarea(TextArea2)中查看和复制该字符?

提前感谢您的帮助。

<html>
<head>
<title>Central Batch</title>

<HTA:Application
ApplicationName="HTACentralBatch"
Border="Thin"
BorderStyle="Static"
Caption="Yes"
ContextMenu="No"
Icon="WScript.exe"
ID="HTACentralBatch"
InnerBorder="No"
MaximizeButton="No"
Scoll="No"
ShowInTaskbar="Yes"
SingleInstance="Yes"
WindowState="Normal"/>

<SCRIPT Type="Text/VBScript">
'----------------------------------------------------------------------
WidthX  = "525"
HeightY = "323"
Window.ResizeTo WidthX, HeightY
Window.MoveTo (screen.Width - WidthX)/2, (screen.Height - HeightY)/2

Set WshShell = CreateObject("WScript.Shell")
Set WshFSO   = CreateObject("Scripting.FileSystemObject")

aString = "abcd "

nString = "19 25"

nTotal = "" : bString = aString
'-----------------------------------------------------------------------------------
Sub Window_OnLoad()
    nTotal = Len(aString)
    For i = 1 to nTotal
        bString = Replace(bString, Mid(aString, i, 1), "_" & Mid(aString, i, 1))
    Next
    Window.SetInterval "Conversor", 150
End Sub
'-----------------------------------------------------------------------------------
Sub Conversor()
    cTexto = Document.all.TextArea1.value
    a = 1 : b = a

    For i = 1 to nTotal
        cTexto = Replace(cTexto, Mid(aString, i, 1), Mid(bString, a, 2))
        a = a + 2
    Next

    For i = 1 to nTotal
        cTexto = Replace(cTexto, Mid(bString, b, 2), Mid(nString, i, 1))
        b = b + 2
    Next

    Document.all.TextArea2.value = cTexto
End Sub
'-----------------------------------------------------------------------------------
</SCRIPT>
</head>
<body bgcolor="#204C77" style="overflow:hidden">
<textarea id="TextArea1"
 style="border:solid 5px #BDC3C7; width:491px" rows="5"></textarea><p>

<textarea id="TextArea2" readOnly="True"
 style="border:solid 5px #BDC3C7; width:491px" rows="5"></textarea>

</body>
</html>

0 个答案:

没有答案