Assign a variable using BinaryFormatter


I have a few variables I need to be set using a binaryformatter when I deserialize. I just don’t know how to do it. This is currently my code for this.

BinaryFormatter bf = new BinaryFormatter();
FileStream file = File.Open(loadLocation + lvlName, FileMode.Append);

author = (string)bf.Deserialize(file);
name = (string)bf.Deserialize(file);

Thanks in advance!

So I found a way of doing all this. I followed this tutorial:

It was that easy.