❔ How do I store data properly?
So I'm streaming on Twitch and I have a program called Streamer.Bot which allows me to use C# to execute code.
I have a very basic and limited understanding about C# and coding in general ~ what I'm trying to do is store my viewers data in specific categories I define myself.
The main problem I'm having is understanding how to store the acquired data into a file (I haven't figured out another way yet, either .txt, .csv or .ini).
An example how I'm imagining it:
.ini file is named after my viewer's username in a folder with all the others:
I wanna be able to read it and override specific keys if I so desire. (Most of it is automatic)
To sum it up, I know how to write it into a file but I don't know how to format it properly and check for specific sections and key+values and override them.
4 Replies
You probably wanna use a JSON file for this
So perhaps you have two categories, regular and super, then your JSON could look like this I don't really know what you want, but JSON is very flexible, and it's very easy to convert JSON to and from C# data structures.
Oh yea, thats seems like exactly what Im looking for. I will look into it! Thank you
Also, C# has a built-in way to serialize and deserialize JSON
So that's one dependency less that you'd need to handle TOML or some other format
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.