maidinhdan > 18-07-15, 10:18 PM
Public Function Taopassngaunhien(Dodaimatkhau As Integer) As String
Dim RetVal As String
Dim Max As Integer
Dim Min As Integer, i As Integer
Max = 126
Min = 48
Randomize Timer
For i = 1 To Dodaimatkhau
RetVal = RetVal & Chr(Int((Max - Min + 1) * Rnd + Min))
Next i
Taopassngaunhien = RetVal
End Function
Taopassngaunhien(8)
maidinhdan > 19-07-15, 01:29 PM
Public Function Taopassngaunhien2(Dodaicantao As Integer) As String
Dim sTmp As String
sTmp = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
Dim i, RndPos As Integer
Randomize
For i = 1 To Dodaicantao
RndPos = Int(Len(sTmp) * Rnd + 1)
Taopassngaunhien2 = Taopassngaunhien2 & Mid$(sTmp, RndPos, 1)
Next i
End Function
Taopassngaunhien2(8)
NguyenDungAnh > 15-08-18, 10:57 PM