binaryreader - C# Binary Reader -


i'm making encryption program , need save encrypted password file using binary reader , writer. when try , read data out number. did wrong?

 public static string readdata(string filename)     {         string data;          filestream fstream = new filestream(filename, filemode.open, fileaccess.read);          using (binaryreader reader = new binaryreader(fstream))         {             data = reader.read().tostring();         }          return data;        } 

and writer

 public static void writedata(string filename, string data)  {    using (binarywriter writer = new binarywriter(file.open (filename, filemode.create)))         {             writer.write(data);         }     } 

use reader.readstring() instead.

data = reader.readstring(); 

the read method reads next character , returns corresponding integer value of can see in documentation.basically, have written string file in binary format, need read back.


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -