Sto provando a scrivere un flusso sulla ram anziché su un file. Ho provato a fare questo:Scrive su uno stream come se fosse un file, ma scrive realmente su un oggetto
Stream stream = new MemoryStream();
BinaryFormatter bFormatter = new BinaryFormatter();
bFormatter.Serialize(stream, objectToSerialize);
stream.Close();
return stream;
Ma quando guardo il flusso dopo aver presumibilmente scritta ad esso si sta dicendo "Lunghezza = 'stream.Length' ha generato un'eccezione di tipo 'System.ObjectDisposedException'"
Grazie che ha fatto il trucco. –