B
Bob Cummings
Good Day
I would like to write a password to a binary file. I am following along
in the book and examples I have found googling. However when I open
the file in notepad it looks like a text file. Can someone tell me what
I am doing wrong?
try
{
if (sfdCommon.ShowDialog() ==
System.Windows.Forms.DialogResult.OK)
{
System.IO.Stream fs = File.Create(sfdCommon.FileName);
System.IO.BinaryWriter bw = new BinaryWriter(fs);
char [] b;
b=this.txtPassWord.Text.ToCharArray();
bw.Write(b);
bw.Close();
fs.Close();
}
}
catch(System.Exception ex)
{
System.Windows.Forms.MessageBox.Show (ex.StackTrace);
}
cheers
Bob
I would like to write a password to a binary file. I am following along
in the book and examples I have found googling. However when I open
the file in notepad it looks like a text file. Can someone tell me what
I am doing wrong?
try
{
if (sfdCommon.ShowDialog() ==
System.Windows.Forms.DialogResult.OK)
{
System.IO.Stream fs = File.Create(sfdCommon.FileName);
System.IO.BinaryWriter bw = new BinaryWriter(fs);
char [] b;
b=this.txtPassWord.Text.ToCharArray();
bw.Write(b);
bw.Close();
fs.Close();
}
}
catch(System.Exception ex)
{
System.Windows.Forms.MessageBox.Show (ex.StackTrace);
}
cheers
Bob