Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Save object to binary file

Status
Not open for further replies.

ralphtrent

Programmer
Jun 2, 2003
958
US
Hello
I would like to save a datatable or any other object to a binary file. Is serialization the only way to do that? If so, then the object gets saved in clear text and you can see the data if you view the binary file in notepad. Its not a problem, I just do not like to have that type of stuff in clear text. Does anyone have any thoughts on this?

Thanks,
Ralph
 
why not use a database? if you want to encrypt the data, that should be done before serializing the object.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
My goal is to make a stand alone app with out requiring a database or database connectivity on the client
 
If your app is relatively small without the need for complex data relations then using a XML as a local data store is an option. Just encrypt before serialising.
 
encyrpting was the other option i was leaning toward, but not sure the best way to do so, any ideas on how to encrypt. I have a class that i download a while ago that encrypt strings very well. I was able to use a string builder to encrypt then serialize, but I was not sure how to deserialze the encrypted string. Any idea's?

Thanks.
 
There are a number of .NET classes that you can use for encryption under the System.Security.Cryptography namespace. Also, if you don't need to secure the file but just want to hide *clear text*, you can also consider compressing the file. Again, there are builtin compression utilities on .NET that you can use. look on System.IO.Compression
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top