那位高手给写一对base64加密和解密的UiBot函数?需脱离互联网应用

刘诗 2021-2-8 1273

那位高手给写一对base64加密和解密的UiBot函数?需脱离互联网应用

最新回复 (10)
  • 隨筆塗鴉 2021-2-23
    2

    在项目的extend/python目录新建一个文件【base64str.py】,然后用vscode之类的工具打开它,

    然后写入以下代码:

    import base64
    
    
    def encode(target):
        return str(base64.b16encode(target.encode('utf-8')), 'utf-8'
    
    def decode(target):
        return str(base64.b16decode(target), 'utf-8')



    然后在项目模块里,调用你写好的python模块:

    Import base64str
    
    my_str = base64str.encode("my_str")
    TracePrint my_str
    my_str = base64str.decode(my_str)
    TracePrint my_str


    结果如图所示:


  • lhui 2021-2-24
    3
    又学到一招,谢谢 隨筆塗鴉  !!
  • 隨筆塗鴉 2021-2-24
    4
    lhui 又学到一招,谢谢 隨筆塗鴉 !!
    官方教程参见:
    https://docs.uibot.com.cn/guide/d2/ch010.html?version=0.31213233818690034#用python编写插件
  • lhui 2021-2-24
    5
    隨筆塗鴉 官方教程参见: https://docs.uibot.com.cn/guide/d2/ch010.html?version=0.31213233818690034#用python编写插件
    我已经用python写过两个插件了:1.自定义对话框 2.北大法宝滑块验证,但是还是很多不懂的。
  • 刘诗 2021-3-4
    6



  • lhui 2021-3-4
    7
    贴你的base64str.py看看?
  • 刘诗 2021-3-4
    8


  • life 2021-3-4
    9
    放安装目录不是工程目录
  • lhui 2021-3-4
    10

    会不会该文件名为txt,而你另有一个文件base64str.py ?


    而且少了一个括号,应该是:

    return str(base64.b16encode(target.encode('utf-8')), 'utf-8')

  • 刘诗 2021-3-5
    11

    好使了!就是因为少了半个括号!
    经测试,.py文件放安装目录和工程目录都好使。
    谢谢!非常感谢!!!

返回
发新帖