![](/img/trans.png)
[英]I have an array of colors and I want to assign the colors with the labels in the for loop in C#. How can I do so?
[英]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.