I have some code in PHp, which I am trying to redo in C#. The PHP code has something like fputs($file,serialize($val))
What could be the dot NET specifically C# equivalent of Serialize???
using (Stream stream = File.Open(filePath, FileMode.Create))
{
BinaryFormatter bformatter = new BinaryFormatter();
bformatter.Serialize(stream, myObject);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With