Answer the question
In order to leave comments, you need to log in
Saving config to JSON?
In general, I created a program in which profiles are loaded into a combobox from a text document, its contents:
As a result, we have 2 lines in the combobox, well, it's logical.
Further below the combobox there are 2 fields, I enter the data there, and press the save button. The JSON config was saved easily, without any problems:
JsonSerializer jsonSerializer = new JsonSerializer();
TextWriter writer = new StreamWriter("DataProfiles\\" + this.namez + ".json");
jsonSerializer.Serialize(writer, this);
writer.Close();
FileStream fileStreamz = new FileStream("DataProfiles\\" + profiles3[0] + ".json", FileMode.Open);
string jsoncon = JsonConvert.SerializeObject(fileStreamz);
dtprof = (Dataprofiles)JsonConvert.DeserializeObject(jsoncon);
fileStreamz.Close();
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question