c# - Reading a binary file into a textblock -
I want to read an exe or any binary file content in a text block in C #. I have the following code, but when I start reading the file, the application is stuck. My code is given below:
using (file stream fs1 = new file stream (phapath, flamod.open, file entry read)) {byte [] buf = new byte [ 1024]; Int size = 0; While ((size = fs1.Read (buf, 0, buf.Length)) gt; 0) {Console.Write ("[" + buf.Length + "/" + size + "]); textbox.ext + Encoding.default.getstring (buf)}} Please guide me how I can solve this problem.
If you want to read the entire file, you can use it.
byte [] bytes = file .ReadLabets (Payapath ); TextBox.text = encoding.default.getstrings (bytes); When you read the chunks, then this whole d Code can not represent the string can sometimes ended characters require more than one byte and separate segments.
Comments
Post a Comment