繁体   English   中英

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

[英]how to convert (3 digit) Decimal to Ascii from textbox.text?

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

前任:

输入:

11311711511597105 = 11311711511597105

输出:

qussai = qussai

你应该向我们展示你的尝试。

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

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM