Olá Pessoal, faz pouco tempo que estou programando em C#...
entao estou migrando algumas coisas de VB6 para C#.... e gostaria de saber como faço
isso..
Function DeCripto(ByVal InputString As String) As String
Dim OutputString As String
Dim DecodeKey As Variant
Dim x As Integer
For x = 1 To Len(InputString)
DecodeKey = x Mod 26
OutputString = OutputString & Chr$(Asc(Mid$(InputString, x, 1)) - DecodeKey)
Next
DeCripto = OutputString
End Function
Function EmCripto(ByVal InputString As String) As String
Dim OutputString As String
Dim DecodeKey As Variant
Dim x As Integer
For x = 1 To Len(InputString)
DecodeKey = x Mod 26
If DecodeKey + Asc(Mid$(InputString, x, 1)) > 255 Then
OutputString = OutputString & Chr$(255)
Else
OutputString = OutputString & Chr$(DecodeKey + Asc(Mid$(InputString, x, 1)))
End If
Next
EmCripto = OutputString
End Function
Obrigado.