Код: Выделить всё
public void serialize()
{
try
{
XmlSerializer ser = new XmlSerializer(typeof(Repository));
StreamWriter myWriter = new StreamWriter("stud.xml");
ser.Serialize(myWriter, rep);
myWriter.Close();
}
catch (Exception e)
{
Console.WriteLine("Error " + e.Message);
}
}
Код: Выделить всё
public class Repository : MyStack
{
public int size;
public int capacity;
public SLL stud;
public Repository()
{
/*
* Creator for class Repository.
*/
this.stud = new SLL();
this.capacity = 20;
this.size = 0;
}
Подробнее здесь: https://stackoverflow.com/questions/210 ... in-c-sharp
Мобильная версия