吾爱破解 - 52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 8659|回复: 5
收起左侧

[其他转载] 密码生成算法(非随机生成.)

   关闭 [复制链接]
幼儿园小班 发表于 2011-5-22 01:08
Function CreateString(YStr As String, Optional StrLen As Long = 6, Optional NumPD As Boolean = True, Optional UAPD As Boolean = True, Optional LAPD As Boolean = True, Optional TSFHPD As Boolean = False, Optional TSFH As String = "/*-+~!@#$%^&()_=\;:'"",.<>?") As String
    Dim SLen As Long, I As Long
    Dim S() As String, TAsc As Long
    Dim TStr As String, JWPD As Boolean
    Dim JgStr As String
    Const NumMin As Long = 48
    Const NumMax As Long = 57
    Const UAMin As Long = 65
    Const UAMax As Long = 90
    Const LAMin As Long = 97
    Const LAMax As Long = 122
    TStr = ""
    JgStr = ""
    If UAPD Then TStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
    If LAPD Then TStr = TStr & "abcdefghijklmnopqrstuvwxyz"
    If NumPD Then TStr = TStr & "0123456789"
    If TSFHPD Then TStr = TStr & TSFH
    If YStr = "" Then
        For I = 1 To StrLen
            YStr = YStr & Left(TStr, 1)
        Next
    End If
    SLen = Len(YStr)
    ReDim S(SLen - 1)
    For I = 1 To SLen
        S(I - 1) = Mid(YStr, I, 1)
        JgStr = JgStr & Right(TStr, 1)
    Next
    If Join(S, "") = JgStr Then CreateString = "": Exit Function
    If S(UBound(S)) = Right(TStr, 1) Then
        S(UBound(S)) = Left(TStr, 1)
        For I = SLen - 1 To 1 Step -1
            If JWPD Then S(I - 1) = Left(TStr, 1)
            JWPD = False
            If S(I - 1) = Right(TStr, 1) Then
                S(I - 1) = Left(TStr, 1)
                JWPD = True
            Else
                S(I - 1) = Mid(TStr, InStr(TStr, S(I - 1)) + 1, 1)
                Exit For
            End If
        Next
    Else
        S(UBound(S)) = Mid(TStr, InStr(TStr, S(UBound(S))) + 1, 1)
    End If
    CreateString = Join(S, "")
End Function

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

oignon 发表于 2011-5-22 03:15
支持下楼主,继续加油啊!!!!!
lyq_superior 发表于 2011-5-27 00:19
shopmall66 发表于 2011-6-22 20:33
xxhaishixx 发表于 2012-1-31 23:20
支持~源码发布~感谢lZ,最近把AES模块化了,也就是弄成了DLL插件COM接口的形式了,用的人还有点多。
古尼拉亚登 发表于 2012-2-9 14:26
VB?要是易语言源码的话就多好!
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

返回列表

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-11-16 19:29

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

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