繁体   English   中英

如何在C#中将ASCII小数转换为字符串。 这是我到目前为止的代码:

[英]How do I convert ASCII decimals to a string in C#. This is the code I have so far:

这是我尝试过的。请建议我如何将Assci代码转换为字符。

 class Decryption
        {
            static void Main()
            {
                string file = @"C:\Users\Me\OneDrive\CSharpProgramming\CipherText.txt";

                string text = File.ReadAllText(file);

                // displaying the contents of the file being read from...
                Console.WriteLine("  Encrypted Text: \n\n{0}", text);

                foreach (char c in text)
                {

                    int ASCIIValues = (char)c - 4;
                    Console.Write(ASCIIValues);

                }

                Console.ReadLine();

你想要这个吗

int ascii = 50;
    char b = (char)ascii;

尝试这个

int[] arr;
for(i<n)
{
string p += (char)arr[i]+4;
}

暂无
暂无

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

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