Alex,
If the object is marked with the Serializable attribute, then you can
create a BinaryFormatter and then serialize it to a filestream, like so:
// Create a file stream.
using (FileStream fileStream = new FileStream(@"c:\temp\obj.bin",
FileMode.CreateNew, FileAccess.Write, FileShare.None))
{
// Create a formatter.
IFormatter formatter = new BinaryFormatter();
// Serialize.
formatter.Serialize(fileStream, obj);
}
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"Alex Wagner" <gb*****@hot-nospam-mail.com> wrote in message
news:OS**************@TK2MSFTNGP09.phx.gbl...
I know it must be a very simple thing to do but I'm just brain dead
today...
sorry...
how can I save an object to the filesystem??
object obj = GetMyObject();
// insert code to save to file system...
Please HELP...
thanks.
Alex