Crear Serial a Partir de Cadena en Visual Basic 6
Option Explicit
Private Function getSerial(Cadena As String) As String
Dim StrLen As Integer
Dim I As Integer
Dim strHex As String
Cadena = Trim(Cadena)
StrLen = Len(Cadena)
For I = 1 To StrLen
strHex = strHex & Hex(Val(Asc(Mid(Cadena, I, 1))) * StrLen)
Next
getSerial = Mid(strHex, 1, 4) & "-" & Mid(strHex, 5, 4) & "-" & Mid(strHex, 9, 4) & "-" & Mid(strHex, 13, 4)
End Function
Private Sub Command1_Click()
MsgBox getSerial(Text1)
End Sub
Yal Publicidad
Web master: Yuri Lizama
www.yalpublicidad.com/blog/
ENLACES RELACIONADOS
Option Explicit
Private Function getSerial(Cadena As String) As String
Dim StrLen As Integer
Dim I As Integer
Dim strHex As String
Cadena = Trim(Cadena)
StrLen = Len(Cadena)
For I = 1 To StrLen
strHex = strHex & Hex(Val(Asc(Mid(Cadena, I, 1))) * StrLen)
Next
getSerial = Mid(strHex, 1, 4) & "-" & Mid(strHex, 5, 4) & "-" & Mid(strHex, 9, 4) & "-" & Mid(strHex, 13, 4)
End Function
Private Sub Command1_Click()
MsgBox getSerial(Text1)
End Sub
Yal Publicidad
Web master: Yuri Lizama
www.yalpublicidad.com/blog/
ENLACES RELACIONADOS
Comentarios
Publicar un comentario