|
发表于 2024-1-1 21:21:20
|
显示全部楼层
本帖最后由 qq413774005 于 2024-1-1 21:22 编辑
#Region ;**** 参数创建于 ACNWrapper_GUI ****
#AutoIt3Wrapper_icon=C:\Windows\system32\SHELL32.dll|-210
#AutoIt3Wrapper_UseUpx=n
#AutoIt3Wrapper_UseX64=n
#AutoIt3Wrapper_Res_Comment=汉字区位码转换
#AutoIt3Wrapper_Res_Description=汉字区位码转换
#AutoIt3Wrapper_Res_Fileversion=1.1.0.0
#AutoIt3Wrapper_Res_LegalCopyright=汉字区位码转换
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
#PRE_UseX64=n
#PRE_Res_requestedExecutionLevel=None
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <String.au3>
Opt("GUIOnEventMode", 1)
$TXT_1 = "1234567890KV" & @CRLF & "ABCDEFGHIGKLMNOPQISTUVWXYZ" & @CRLF & "电容器室" & @CRLF & "二次室" & @CRLF & "GIS室" & @CRLF & "主控室" & @CRLF & "开关室" & @CRLF
$TXT_2 = "电缆沟层" & @CRLF & "电容器室" & @CRLF & "工具间" & @CRLF & "蓄电池室" & @CRLF & "走廊" & @CRLF & "门卫室" & @CRLF & "仪表室" & @CRLF & "东南西北" & @CRLF & "上下左右" & @CRLF
#region ### START Koda GUI section ###
$Form1 = GUICreate("汉字区位码转换器V1.1", 700, 300, @DesktopWidth / 2-350 , @DesktopHeight / 2-150 )
GUISetOnEvent($GUI_EVENT_CLOSE, "Click2close")
$Edit1 = GUICtrlCreateEdit("", 8, 8, 210, 280, BitOR($ES_AUTOVSCROLL, $ES_WANTRETURN, $WS_VSCROLL))
GUICtrlSetData(-1, $TXT_1 & $TXT_2)
$Edit2 = GUICtrlCreateEdit("", 325, 8, 370, 280, BitOR($ES_AUTOVSCROLL, $ES_WANTRETURN, $WS_VSCROLL))
GUICtrlSetFont(-1, 10)
$Button1 = GUICtrlCreateButton(">> 转换 >>", 230, 150, 85, 25, $BS_CENTER)
GUICtrlSetOnEvent(-1, "Button1Click")
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###
Func Click2close()
Exit
EndFunc ;==>Click2close
While 1
Sleep(100)
WEnd
Func Button1Click();汉字区位码
Local $string = GUICtrlRead($Edit1)
Local $newstr = ""
For $i = 1 To StringLen($string)
$newstr = $newstr & getqw(StringMid($string, $i, 1))
Next
$string = $newstr
GUICtrlSetData($Edit2, $string)
EndFunc ;==>Button1Click
Func getqw($ch)
$casc = Dec(_StringToHex($ch))
If $casc < 0 Then
$casc = $casc + 65535 + 1
ElseIf $casc > 255 Then
$casc = Hex($casc, 4)
$b1 = StringRight(StringFormat("00%d%d", Dec(StringLeft($casc, 2)) - 160), 2)
$b2 = StringRight(StringFormat("00%d%d", Dec(StringRight($casc, 2)) - 160), 2)
$return = $ch & $b1 & $b2 & " "
Return $return
Else
Return $ch
EndIf
EndFunc ;==>getqw
|
|