private void SerializeXml(string log, string pass) { var dataRemember = new InfoCheckBox { Login = log, Password = pass }; var xmlFormatter = new XmlSerializer(typeof(InfoCheckBox)); using (var file = new FileStream("checkBoxXml.xml", FileMode.OpenOrCreate)) xmlFormatter.Serialize(file, dataRemember); }
private void SerializeJson(string log, string pass) { var dataRemember = new InfoCheckBox { Login = log, Password = pass }; var jsonFormatter = new DataContractJsonSerializer(typeof(InfoCheckBox)); using (var file = new FileStream("checkBoxJson.json", FileMode.OpenOrCreate)) jsonFormatter.WriteObject(file, dataRemember); }