Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

c# update value in a json file

string json = File.ReadAllText("settings.json");
dynamic jsonObj = Newtonsoft.Json.JsonConvert.DeserializeObject(json);
jsonObj["Bots"][0]["Password"] = "new password";
string output = Newtonsoft.Json.JsonConvert.SerializeObject(jsonObj, Newtonsoft.Json.Formatting.Indented);
File.WriteAllText("settings.json", output);
Comment

PREVIOUS NEXT
Code Example
Csharp :: how to make an object invisible unity 
Csharp :: c# streamwriter 
Csharp :: how to reference a child object unity 
Csharp :: convert int to short c# 
Csharp :: unity random 
Csharp :: is keyboard clicked in Unity 
Csharp :: list with two values c# 
Csharp :: how to add item to listbox in c# 
Csharp :: c# hello world 
Csharp :: c# how to get connection string from app config 
Csharp :: c# socket listen on port 
Csharp :: c# tostring currency 
Csharp :: c# split on multiple characters 
Csharp :: slider.onchanged in unity 
Csharp :: c# datagridview filter textbox 
Csharp :: C# array index tostring 
Csharp :: enum element count C# 
Csharp :: untiy instanciate prefab 
Csharp :: c# integer to bit string 
Csharp :: c# minus days from datetime 
Csharp :: how to do time.deltatime in c# 
Csharp :: restart level unity 
Csharp :: implement custom string to datetime convert net core 
Csharp :: create instance of class given class name string c# 
Csharp :: replace index in string c# 
Csharp :: string to biginteger c# 
Csharp :: list to list<selectlistitem c# 
Csharp :: c# inline array initialization 
Csharp :: get attribute value of xml element c# 
Csharp :: c# for loop next iteration 
ADD CONTENT
Topic
Content
Source link
Name
5+2 =