J
jj
It seems simple but I had a hard time converting this small function from
vb.net to C#. I even tried the
software that automatically converts from vb to c# , but to no avail.
Please can someone take some precious minutes to help me out.
Thanks
John
Public Function SimpleCrypt( ByVal Text As String) As String
Dim strTempChar As String, i As Integer
For i = 1 To Len(Text)
If Asc(Mid$(Text, i, 1)) < 128 Then
strTempChar = CType(Asc(Mid$(Text, i, 1)) + 49, String)
ElseIf Asc(Mid$(Text, i, 1)) > 128 Then
strTempChar = CType(Asc(Mid$(Text, i, 1)) - 49, String)
End If
Mid$(Text, i, 1) = Chr(CType(strTempChar, Integer))
Next i
Return Text
End Function
vb.net to C#. I even tried the
software that automatically converts from vb to c# , but to no avail.
Please can someone take some precious minutes to help me out.
Thanks
John
Public Function SimpleCrypt( ByVal Text As String) As String
Dim strTempChar As String, i As Integer
For i = 1 To Len(Text)
If Asc(Mid$(Text, i, 1)) < 128 Then
strTempChar = CType(Asc(Mid$(Text, i, 1)) + 49, String)
ElseIf Asc(Mid$(Text, i, 1)) > 128 Then
strTempChar = CType(Asc(Mid$(Text, i, 1)) - 49, String)
End If
Mid$(Text, i, 1) = Chr(CType(strTempChar, Integer))
Next i
Return Text
End Function