赞 | 451 |
VIP | 56 |
好人卡 | 75 |
积分 | 423 |
经验 | 124650 |
最后登录 | 2024-11-14 |
在线时间 | 7598 小时 |
Lv5.捕梦者 (管理员) 老黄鸡
- 梦石
- 0
- 星屑
- 42339
- 在线时间
- 7598 小时
- 注册时间
- 2009-7-6
- 帖子
- 13506
|
在你的脚本最上面插入一页新页,粘贴以下内容,
然后变量设置的地方改成
ENV['UserName'].s2u
- class String
- @@MultiByteToWideChar = Win32API.new('kernel32', 'MultiByteToWideChar', 'ilpipi', 'i')
- @@WideCharToMultiByte = Win32API.new('kernel32', 'WideCharToMultiByte', 'ilpipipp', 'i')
- def u2w
- i = @@MultiByteToWideChar.call(65001, 0 , self, -1, nil,0)
- buffer = "\0" * (i*2)
- @@MultiByteToWideChar.call(65001, 0 , self, -1, buffer, i)
- buffer.chop!
- return buffer
- end
- def u2s
- i = @@MultiByteToWideChar.call(65001, 0 , self, -1, nil,0)
- buffer = "\0" * (i*2)
- @@MultiByteToWideChar.call(65001, 0 , self, -1, buffer, i)
- i = @@WideCharToMultiByte.call(0, 0, buffer, -1, nil, 0, nil, nil)
- result = "\0" * i
- @@WideCharToMultiByte.call(0, 0, buffer, -1, result, i, nil, nil)
- result.chop!
- return result
- end
- def s2u
- i = @@MultiByteToWideChar.call(0, 0, self, -1, nil, 0)
- buffer = "\0" * (i*2)
- @@MultiByteToWideChar.call(0, 0, self, -1, buffer, buffer.size / 2)
- i = @@WideCharToMultiByte.call(65001, 0, buffer, -1, nil, 0, nil, nil)
- result = "\0" * i
- @@WideCharToMultiByte.call(65001, 0, buffer, -1, result, result.size, nil, nil)
- result.chop!
- return result
- end
- end
复制代码 |
|