Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [Serializable]
- class Price
- {
- private Product[] priceList;
- private int nElems;
- private double sum;
- public Price()
- {
- priceList = new Product[100];
- nElems = 0;
- sum = 0.0;
- }}
- Price price = new Price();
- BinaryFormatter binFormat = new BinaryFormatter();
- // Сохранить объект в локальном файле.
- using (Stream fStream = new FileStream("file.dat",
- FileMode.Create, FileAccess.Write, FileShare.None))
- {
- binFormat.Serialize(fStream, price);
- }
Add Comment
Please, Sign In to add comment