如何从(textbox.text)转换(3位)十进制到Ascii?

时间:2016-03-24 16:50:06

标签: vb.net visual-studio-2015

当我将十进制数字输入到文本框时,输出将是一个单词

EX:

输入:

textbox.text = 11311711511597105

输出:

textbox.text = qussai

1 个答案:

答案 0 :(得分:0)

您应该告诉我们您尝试过的内容。

完整的代码应该是这样的:

Module VBModule
    Sub Main()
        Dim output As String = DecimalToASCII("113117115115097105")
        Console.WriteLine(output)
    End Sub

    Function DecimalToASCII(ByVal input As String) As String
        Dim current As String = ""
        Dim temp As Integer = 0
        If input.Length Mod 3 <> 0 Then
            Return "Wrong Input"
        End If
        For i As Integer = 0 To input.Length - 1 Step 3
            temp = 0
            For j As Integer = i To i + 2
                temp *= 10
                temp += CType(input(j).ToString(), Integer)
            Next
            current &= Chr(temp).ToString()
        Next
        Return current
    End Function
End Module