Does anyone know how to store the contents of a file then read to a string array, then convert it to hex, then read it to a richtextbox and then read to a second string and convert it back to text and save to the original file?
the file is opened through the openfiledialog method; where I then browse for the file (using a filter) select and the open i.e -:
I tried using this :Code:OpenFileDialog dialog = new OpenFileDialog(); dialog.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*"; dialog.InitialDirectory = "@c:\\"; dialog.Title = "Select a text file";
to read the file to a string, But the variable after new StreamReader(.... ) I can't quite get. Any help would be much appreciated.Code:StreamReader streamReader = new StreamReader(OpenFileDialog.dialog); string text = streamReader.ReadToEnd(); streamReader.Close();