Good day!
In windos form through textboxes, data is entered and edited for 4x multi-dimensional arrays.
Upon completion of the work, it is necessary that all elements of the arrays retain their current value, and when you start the program again, load the latest data.
I looked for a solution, I saw serialization. I tried binary serialization. Not much happened.
ΠΠΎΠ΄: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.IO; using System.Runtime.Serialization.Formatters.Binary; using System.Runtime.Serialization; namespace CityStatic { [Serializable] class Mass { public uint[,,,,,] massive { get; set; } public uint[,,,,,] massive1 { get; set; } public uint[,,,,,] massive2 { get; set; } public uint[,,,,,] massive3 { get; set; } public Mass(uint[,,,,,] massive, uint[,,,,,] massive1, uint[,,,,,] massive2, uint[,,,,,] massive3, uint[,,,,,]) { //??? } } public partial class Form1 : Form { public Form1() { InitializeComponent(); } //Π‘ΠΎΠ·Π΄Π°Π½ΠΈΠ΅ ΠΌΠ°ΡΡΠΈΠ²Π° //-------------------- Mass[,,,,,] massive = new Mass[10, 10, 10, 10, 11, 11]; Mass[,,,,,] massive1 = new Mass[10, 10, 10, 10, 11, 11]; Mass[,,,,,] massive2 = new Mass[10, 10, 10, 10, 11, 11]; Mass[,,,,,] massive3 = new Mass[10, 10, 10, 10, 11, 11]; /* Π·Π΄Π΅ΡΡ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠ° ΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΠ΅Π»ΡΡΠΊΠΎΠ³ΠΎ Π·Π°ΠΏΠΈΡΠΈ Π΄Π°Π½Π½ΡΡ
Π² ΠΌΠ°ΡΡΠΈΠ²Ρ ΠΏΡΡΠ΅ΠΌ Π²Π²ΠΎΠ΄Π° Π² ΡΠ΅ΠΊΡΡΠ±ΠΎΠΊΡΡ, ΠΏΡΠΈ Π½Π°ΠΆΠ°ΡΠΈΠΈ Π½Π° ΠΎΠ΄Π½Ρ ΠΈΠ· 4Ρ
ΠΊΠ½ΠΎΠΏΠΎΠΊ ΠΎΡΠ½ΠΎΡΠΈΡ Π·Π°ΠΏΠΈΡΡ Π² ΠΎΠ΄ΠΈΠ½ ΠΈΠ· 4Ρ
ΠΌΠ°ΡΡΠΈΠ²ΠΎΠ² */ BinaryFormatter formatter = new BinaryFormatter(); using (FileStream fs = new FileStream("mass.dat", FileMode.OpenOrCreate)) // Π·Π΄Π΅ΡΡ Π²ΡΠ΅ ΠΊΡΠ°ΡΠ½ΠΎΠ΅ { formatter.Serialize(fs, massive); // Π·Π΄Π΅ΡΡ ΡΠΎΠΆΠ΅ } }
using System.IO;It is in the file where you are doing the serialization. Or do you have everything in a heap in one file? - Alexander Petrov