Basically I have have a program that creates an array of bytes (manually entered via a richtextbox and I want to be able to create a new file and save the bytes in that file via a SaveFileDialog() method.
The code I have come up with is:
byte[] bytes = Encoding.ASCII.GetBytes(richTextBox1.Text);
Stream stream = new MemoryStream(bytes);
SaveFileDialog file = new SaveFileDialog();
file.ShowDialog();
if (file.FileName != "")
{
using (BinaryWriter bw = new BinaryWriter(stream))
{
bw.Write(bytes);
}
}