How to serialize and compress an object to FileStream?: "try
{
FileStream fs = new FileStream(@"C:\Projects\Test\Test.txt", FileMode.Open);
GZipStream decompressor = new GZipStream(fs, CompressionMode.Decompress);
BinaryFormatter bf = new BinaryFormatter();
CUnits ds = (CUnits)bf.Deserialize(decompressor);
decompressor.Close();
fs.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
} "
'via Blog this'
No comments:
Post a Comment