I am having a hard time converting this snippet to VB.NET
Function DecryptPassword(ByVal s As String) As String
Dim i As Integer
Dim sPass As String = s.Trim()
For i = 1 To Len(sPass)
If Asc(Mid$(sPass, i, 1)) - 5 < 124 Then
this line throws "type char $ does not match declared data type char"
Mid$(sPass, i, 1) = Chr$(Asc(Mid$(sPass, i, 1)) - 5)
Else
Mid$(sPass, i, 1) = Mid$(sPass, i, 1)
End If
Next
DecryptPassword = UCase(sPass) Convert UserPassword to UpperCase
End Function
It works well in VB6 but throws error when i VB.Net..