找回密码
 加入
搜索
查看: 1380|回复: 1

[系统综合] 很短的一个VB.NET函数 如何转AU3呢·?[已解决]

[复制链接]
发表于 2012-7-18 09:16:30 | 显示全部楼层 |阅读模式
本帖最后由 sdc7 于 2012-7-19 08:27 编辑

Function EncodePassword(ByVal pass As String, ByVal challange As String) As String
                Dim hash_byte(challange.Length / 2 - 1) As Byte
                For i = 0 To challange.Length - 2 Step 2
                        hash_byte(i / 2) = Byte.Parse(challange.Substring(i, 2), Globalization.NumberStyles.HexNumber)
                Next
                Dim response(pass.Length + hash_byte.Length) As Byte
                response(0) = 0
                Text.Encoding.ASCII.GetBytes(pass.ToCharArray()).CopyTo(response, 1)
                hash_byte.CopyTo(response, 1 + pass.Length)


                Dim md5 = New System.Security.Cryptography.MD5CryptoServiceProvider()

                Dim hash = md5.ComputeHash(response)

                Dim hashStr As New Text.StringBuilder()
                For Each h In hash
                        hashStr.Append(h.ToString("x2"))
                Next
                Return hashStr.ToString()
        End Function


别的方法实现~
发表于 2012-7-18 10:54:40 | 显示全部楼层
呵呵,自己写下咯
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-9-30 05:26 , Processed in 0.101251 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表