-3
Ich habe ein Array mit binären Werten, das habe ich explodiert und in ein Array eingefügt, aber jetzt möchte ich diese Elemente in eine [8, 8] -Matrix verschieben Linie), wie kann ich das tun?Array-Elemente in einer Matrix lesen/einfügen
Ich habe versucht, aber ich konnte etwas Gutes Beispiel nicht gefunden
static void Main(string[] args)
{
string textonorm, textobin = "", textobin1 = "", textocod = "";
int textval, quant, result, txtvalor;
Console.WriteLine("Digite a frase que deseja criptografar!");
textonorm = Console.ReadLine();
textval = System.Text.ASCIIEncoding.UTF8.GetByteCount(textonorm);
byte[] phrase = Encoding.ASCII.GetBytes(textonorm);
foreach (byte b in phrase)
{
textobin += Convert.ToString(b, 2);
textval = textobin.Length;
}
if (textval < 64)
{
quant = 64 - textval;
foreach (byte b in phrase)
{
textobin1 += Convert.ToString(b, 2);
}
textocod = textobin1.PadLeft(quant, '0');
txtvalor = textobin1.Length;
Console.WriteLine(textocod.ToString() + "\r\n " + "\r\n " + txtvalor.ToString());
string[] textarray = textocod.Split('0', '1');
int[,] matrizval = new int[8,8];
foreach (var substr in textarray)
{
Console.WriteLine(Convert.ToString());
}
}
else
{
Console.WriteLine("ok");
}
}