public void PIDSerializeNow(PIDParameters data) { FileStream fileStream = new FileStream(Path_PID, FileMode.OpenOrCreate); BinaryFormatter b = new BinaryFormatter(); b.Serialize(fileStream, data); fileStream.Close(); }
public PIDParameters PIDDeSerializeNow() { PIDParameters data = new PIDParameters(); FileStream fileStream = new FileStream(Path_PID, FileMode.Open, FileAccess.Read, FileShare.Read); BinaryFormatter b = new BinaryFormatter(); data = b.Deserialize(fileStream) as PIDParameters; fileStream.Close(); return(data); }