簡體   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