Answer the question
In order to leave comments, you need to log in
How to concatenate two serialized files?
There is a certain program in which I realized saving the data entered by the user to a file.
SaveFileDialog saveFileDialog = new SaveFileDialog
{
Filter = "DF файлы (*.df)|*.df"
};
if (saveFileDialog.ShowDialog() == true)
{
Mouse.SetCursor(Cursors.Wait);
using (FileStream fs = new FileStream(saveFileDialog.FileName, FileMode.Create))
{
/*var serializer = new XmlSerializer(typeof(ObservableCollection<ListBoxItemVM>));
serializer.Serialize(fs, DevList);*/
DataContractSerializer ser = new DataContractSerializer(typeof(ObservableCollection<ListBoxItemVM>));
ser.WriteObject(fs, DevList);
}
Mouse.SetCursor(Cursors.Arrow);
MessageBox.Show(Application.Current.MainWindow, "Данные сохранены.", "Информация", MessageBoxButton.OK, MessageBoxImage.Information, MessageBoxResult.Cancel);
}
Answer the question
In order to leave comments, you need to log in
Create 3 class with 2 fields and serialize it. And the fact that you came up with a bicycle and crutches. Well, or make a zip archive and shove both files there
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question