Answer the question
In order to leave comments, you need to log in
How to add value to specific key of JSON file?
In general, such a problem. It is necessary that the data that I enter is added to the link.
I tried it in different ways and every time it turns out like this
. And you need everything to be in one link like this:
Here is the code:
string[] rssLinks = Console.ReadLine().Split(new char[] { ' ', '\n', '\t' }, StringSplitOptions.RemoveEmptyEntries);
JObject obj = new JObject(new JProperty("link", rssLinks ));
string path = Environment.CurrentDirectory + @".\RSS_Settings.json";
using (StreamWriter sw = new StreamWriter(path, true, System.Text.Encoding.Default))
{
sw.WriteLine(obj.ToString());
}
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