Why strings are not getting converted to binary form, even if we use
BinaryWriter for writing to a file?
Which is the similar technique in c# as ifstream(filename,
ios::binary) in C++?
My Code:
int version = 1024;
string loginname = "test";
string password = "test";
FileStream fs = new FileStream("C:/test.bin",
FileMode.OpenOrCreate);
BinaryWriter bw = new BinaryWriter(fs);
bw.Write(version);
bw.Write(loginname);
bw.Write(password);
bw.Close();
fs.Close();
The file can be viewed in notepad like this:
testtest
the integer , 'version' is in binary form... but the strings are in
human readable form.
I want to to write all of the datas in a format which cannot be read
from a notepad.
Please somebody help me
chepps