I try to read the hexadecimal file, but nothing happens, I do it
void Read() { FileStream stream = new FileStream("C:\\test.save", FileMode.Open, FileAccess.Read); int leng = (int)stream.Length; byte[] bufer = new byte[stream.Length]; stream.Read(bufer, 0, leng); ASCIIEncoding ascii = new ASCIIEncoding(); string res = ascii.GetString(bufer, 0, leng); richTextBox1.AppendText(res); stream.Close(); }
and it works (somehow), but the file is read for a very long time. void Read () {
FileStream stream = new FileStream("C:\\test.save", FileMode.Open, FileAccess.Read); int leng = (int)stream.Length; byte[] bufer = new byte[stream.Length]; stream.Read(bufer, 0, leng); ASCIIEncoding ascii = new ASCIIEncoding(); char[] chars = ascii.GetChars(bufer); foreach (char ch in chars) { string symb = ch.ToString(); ichTextBox1.AppendText(symb); } stream.Close(); }
Help me please. P.c tag for formatting C # code did not find = (