绿色风's Blog
专注AutoIT(Au3)
  • 首页
  • 流●年
  • 笔●记
    • 学习随记
    • 源码示例
  • 脚●本
    • UDF(收集)
    • 工作室UDF
    • 工具●教程
    • 教程之GDI
  • 作●品
  • 下●载
  • 情怀ExcelTip
11月22014

Hex值十六进制字符串逐行转换

作者:绿色风   发布:2014-11-2 14:21 Sunday   分类:   阅读:9802次   评论:0条  

QQ截图20141102221942.png

 

因写别的程序的需求

用于更新数据

需要配套一个这种小玩具

 

 

 

 

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <String.au3>
#Region ### START Koda GUI section ### Form=D:\永昌20140814\加解密更新\Form1.kxf
$Form1_1 = GUICreate("Hex 转换(逐行)  by:绿色风  blog:www.JianYiIT.com", 581, 548, 292, 124)
$Edit1 = GUICtrlCreateEdit("", 2, 0, 576, 250, BitOR($ES_AUTOVSCROLL, $ES_AUTOHSCROLL, $ES_WANTRETURN, $WS_VSCROLL))
GUICtrlSetData(-1, "Hex值十六进制字符串 逐行转换")
$Edit2 = GUICtrlCreateEdit("", 2, 293, 576, 250, BitOR($ES_AUTOVSCROLL, $ES_AUTOHSCROLL, $ES_WANTRETURN, $WS_VSCROLL))
GUICtrlSetData(-1, "")
$Button1 = GUICtrlCreateButton("Hex 转换", 54, 256, 80, 33)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$Button2 = GUICtrlCreateButton("Hex 还原",  148, 256, 80, 33)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$Button3 = GUICtrlCreateButton("↑↓", 250, 256, 80, 33)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x0000FF)
$Button4 = GUICtrlCreateButton("复制↓",351, 256, 80, 33)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$Button7 = GUICtrlCreateButton("↑粘贴", 449, 256, 80, 33)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1 ;HEX 转换
            Local $arr = StringSplit(GUICtrlRead($Edit1), @CRLF, 1)
            If IsArray($arr) = 1 Then
                Local $str = ""
                For $i = 1 To $arr[0]
                    $str &= _StringToHex($arr[$i]) & @CRLF
                Next
                GUICtrlSetData($Edit2, $str)
            EndIf
            _sFlash()
        Case $Button2 ;HEX 还原
            Local $arr = StringSplit(GUICtrlRead($Edit1), @CRLF, 1)
            If IsArray($arr) = 1 Then
                Local $str  = ""
                For $i = 1 To $arr[0]
                    $str &= _HexToString($arr[$i]) & @CRLF
                Next
                GUICtrlSetData($Edit2, $str)
            EndIf
            _sFlash()
        Case $Button3 ;↑↓ 上下调换
            Local $E1 = GUICtrlRead($Edit1)
            Local $E2 = GUICtrlRead($Edit2)
            GUICtrlSetData($Edit1, $E2)
            GUICtrlSetData($Edit2, $E1)
            _sFlash2()
        Case $Button4 ;复制↓ 下
            Local $E2 = GUICtrlRead($Edit2)
            ClipPut($E2)
            _sFlash()
        Case $Button7 ;↑粘贴 上
            GUICtrlSetData($Edit1, ClipGet())
            _sFlash()
    EndSwitch
WEnd

;对控件上的文本闪烁一下
Func _sFlash($hw = $nMsg)
    GUICtrlSetColor($hw, 0x0000FF)
    Sleep(150)
    GUICtrlSetColor($hw, 0x000000)
    Sleep(150)
    GUICtrlSetColor($hw, 0x0000FF)
    Sleep(150)
    GUICtrlSetColor($hw, 0x000000)
EndFunc   ;==>_sFlash
Func _sFlash2($hw = $nMsg)
    GUICtrlSetColor($hw, 0x000000)
    Sleep(150)
    GUICtrlSetColor($hw, 0x0000FF)
    Sleep(150)
    GUICtrlSetColor($hw, 0x000000)
    Sleep(150)
    GUICtrlSetColor($hw, 0x0000FF)
EndFunc   ;==>_sFlash2```

 

 

下载: Hex值十六进制字符串逐行转换[编译后的].rar

 





本文固定链接: http://www.jianyiit.com/post-15.html

blogger
该日志由 绿色风 于2014-11-2 14:21 Sunday发表在 分类下。
版权所有:《绿色风's Blog》 → 《Hex值十六进制字符串逐行转换》;
除特别标注,本博客很多文章均为原创. 互联分享,尊重版权,转载请以链接形式标明本文地址;
本文标签:

扫描二维码,在手机上阅读
上一篇::获取互联网时间[UDP方式]
下一篇:笑趣乐事

热门文章

相关文章

  • Hex值十六进制字符串逐行转换
  • Au3 求斐波那契数列的第n项 算法
  • 将GUI 窗体置于最低层
  • AU3能清除IE7以上临时文件、Cookie、历史记录、表单数据等内容
  • 直接跳转打开到屏幕显示设置
取消回复

发表评论

亲,头像对么?

84 + 51 =

提交中,请稍候……


木有头像就木JJ啦!还木有头像吗?点这里申请属于你的个性Gravatar头像吧!


    站点统计
    • 运行时间: 20227 天
    • 日志总数: 365 篇
    • 评论数量: 6208 条
    • 微语数量: 6 条
    • 附件总量: 388 件
  • 逝出的青春

  • 打赏"绿色风"



      扫码关注本站公众号 可搜本站内容

  • Autoit V3 脚本交流群

      常驻群1:905774875
      常驻群2:40672266


  • 链接

    • AU3中文论坛
    • Excel资料库
    • 完美者博客
    • 顺网小哥'S Blog
    • 猛牛哥的博客
    • 网吧系统下载
  • 分类

    • 流●年(66)
    • 笔●记(0)
    • 脚●本(0)
    • 作品(21)
    • 学习随记(51)
    • 源码示例(68)
    • UDF(收集)(26)
    • 工作室UDF(30)
    • 工具●教程(62)
    • 教程之GDI(24)
Copyright © 2013 绿色风's Blog. Powered by emlog. Theme by 射雕天龙. 鄂ICP备2021011689号-1 鄂公网安备42102302000078号 sitemap