Hi all i got a CreateR1 function that takes name and hard drive serial number and supposed to return R1 value. The function was actually written on vb2008 but i want some help converting it to vb6. When i post the code on vb6 visual studio some parts of the code shows on red( as i pointed in the code below). So i be happy if you guys help me convert those part to vb6.
Thanks in advance.
vb2008 code:
CreateR1
Thanks in advance.
Code:
Private Function DecryptPass(ByVal sNic As String, ByVal sSerial As String, ByVal sEncryptedPass As String) As String
'Create R1 Encryption Key
Dim R1 As String
R1= CreateR1(sNic, sSerial)
'Decrypt Password
DecryptedPass(R1, sEncryptedPass)
End Function
vb2008 code:
Code:
Private Function CreateR1(ByVal Nic As String, ByVal Serial As String) As String
''Dim s As String = String.Empty
Dim s As String
s = vbNullString
Dim i As Integer
i = 0
If Nic.Length > Serial.Length Then
For Each c As Char In Nic ======================>Shows on red
Dim sTemp As String
Try
sTemp = Serial.Chars(i)
s = s & Nic.Chars(i) & sTemp
Catch
s = s & Nic.Chars(i)
End Try ======================>Shows on red
i = i + 1
Next
Else
For Each c As Char In Serial ======================>Shows on red
Dim sTemp As String
Try
sTemp = Nic.Chars(i)
s = s & sTemp & Serial.Chars(i)
Catch
s = s & Serial.Chars(i)
End Try ======================>Shows on red
i = i + 1
Next
End If
'' Return s.Substring(s.Length - 1) & s.Substring(0, s.Length - 1)
CreateR1 = s.Substring(s.Length - 1) & s.Substring(0, s.Length - 1)
End Function