I'm trying to create a simple Hex Editor with C#. For this I'm writing the file into an byte-array, which works fine. But as soon as I put out the bytes to a Textbox in form of a string, the overall performance of the program becomes pretty bad. For example a 190kb file takes about 40 seconds, till it is displayed in the textbox. While that the program is not responding.
The function:
void open() { fullstring = ""; OpenFileDialog op = new OpenFileDialog(); op.ShowDialog(); file = op.FileName; byte[] fileB = File.ReadAllBytes(file); long b = fileB.Length; for (int i = 0; i < fileB.Length; i++) { fullstring = fullstring + fileB[i].ToString("X") + " "; } textBox9.Text = fullstring; } Is there a way to improve performance in this function?