modlogin.bas
来自「vb写的密码设置、修改系统」· BAS 代码 · 共 59 行
BAS
59 行
Attribute VB_Name = "modLogin"
Public Function CheckDiff(TextBox1 As TextBox, TextBox2 As TextBox, ByVal AllowNull As Boolean) As Boolean
Select Case AllowNull
Case True
If TextBox1.text = TextBox2.text Then
CheckDiff = True
Else
CheckDiff = False
End If
Case False
If TextBox1.text = "" Or TextBox2.text = "" Then
Err.Raise 9394, , "Null String Entered! Please Enter Password!"
Exit Function
End If
If TextBox1.text = TextBox2.text Then
CheckDiff = True
Else
CheckDiff = False
End If
End Select
End Function
Public Sub SavePassword(ByVal appiname As String, ByVal Section As String, ByVal Key As String, ByVal Password As String)
Dim a2s As String
a2s = DE(appiname)
SaveSetting a2s, DE("Option"), DE("Password"), DE(DE(Password))
SaveSetting a2s, DE("Option"), DE("PasswordSaved"), PassSaved(True)
End Sub
Public Function LoadPassword(ByVal appiname As String, ByVal Section As String, ByVal Key As String) As String
Dim a2l As String
a2l = DE(appiname)
LoadPassword = DD(DD(GetSetting(a2l, DE("Option"), DE("Password"), "")))
End Function
Public Function PassSaved(Saved As Boolean) As Double
Select Case Saved
Case False
Randomize
PassSaved = Int(Rnd * 709394) * 17
Case True
Randomize
PassSaved = Int(Rnd * 709394) * 17 + (Int(Rnd * 16) + 1)
End Select
End Function
Public Function ReadPassSaved(ByVal appiname As String, ByVal Section As String, ByVal Key As String) As Boolean
Dim n As Double, r As Integer
n = GetSetting(DE(appiname), DE("Option"), DE("PasswordSaved"), PassSaved(False))
r = n Mod 17
Select Case r
Case 0
ReadPassSaved = False
Case 1 To 16
ReadPassSaved = True
End Select
End Function
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?