Skip to content

Instantly share code, notes, and snippets.

@BrunoCaimar
Created February 28, 2018 18:15
Show Gist options
  • Save BrunoCaimar/68481c422450eae24d72f7dfe8e2ad75 to your computer and use it in GitHub Desktop.
Save BrunoCaimar/68481c422450eae24d72f7dfe8e2ad75 to your computer and use it in GitHub Desktop.
GravarObjectGraphModoBinario.cs
public static void GravarObjectGraphModoBinario(string fileName, object objeto2serialize)
{
using (var stream = new FileStream("C:\\temp\\ObjectGraph.bin",
FileMode.OpenOrCreate,
FileAccess.ReadWrite,
FileShare.ReadWrite))
{
new BinaryFormatter().Serialize(stream, objeto2serialize)
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment