I have the following code that I need to get rid of the Microsoft.VisualBasic function ASC():
Dim keyWithoutDashes As String = p_licenseKey.Replace("-", "").Trim.ToLower
Dim checksum As Int32 = 0
Dim modValue As Byte
Dim checkValue As Byte
Dim checkChar As Char
checksum = 0
checkValue = CByte(Asc(keyWithoutDashes.Substring(24, 1)))
For pos = 0 To 23
checksum += CByte(Asc(keyWithoutDashes.Substring(pos, 1)))
Next
checksum = checksum Mod 34
modValue = CByte(Asc(VALID_CHARACTERS_BACKWARD.Substring(checksum, 1)))
If modValue <> checkValue Then
m_keyErrorMessage = "Invalid LicenseKey"
Return False
End If
I have tried casting as int with no success. Any suggestions?
I need to make the code work in a Microsoft Portable Class Library.