❔ Im making a Game Menu like a steam library but not online
Well i made app but the problem is i cant save added games and i cant remove games in Game Menu and im using flow layout panel and also i want to make a searching box in game menu but idk how can i connect them together
37 Replies
What did you try so far and what do you need help with exactly?
my program isnt saves any added games
Just some starting points to look into, you'll meed to save the library to a file. There's many ways to do that: json, xml, custom binary etc
how can i do can you help me?
im still learning C# on my own way
How to serialize and deserialize JSON using C# - .NET
Learn how to use the System.Text.Json namespace to serialize to and deserialize from JSON in .NET. Includes sample code.
To do proper serialization you also really need to make classes to model your data
i swear i dont know how can i use them
but i need to finish my project too
and my first language isnt english
Starting simple you can always come up with your own text-based standard for writing the data to a file
Doesn't really matter as long as you stick to it so you can then read the data back
It can be as simple as one game per line and have a reserved character to seperate fields
Title;Publisher;ImagePagePath
i have 3 datas in program text, game's place and picture
btw what is publisher
wait
EA, Ubisoft, etc
ok i understand i need to translate sometimes sorry about that
soo how can i make that?
https://www.w3schools.com/cs/cs_files.php Look into the method for reading and writing text
alr
Then just contruct a string when writing, deconstruct the string when reading
i'll try
but first i need to clean my glasses
Good eyesight is important
i didnt understand anything is that normal?
It can take a while to figure out
Files are hard
no its problem about my english
im still dont understand what the site saying
You can use a translator extension in your browser or go to the official docs in your language
https://learn.microsoft.com/en-us/dotnet/api/system.io.file?view=net-7.0 Just change the language at the bottom
File Class (System.IO)
Provides static methods for the creation, copying, deletion, moving, and opening of a single file, and aids in the creation of FileStream objects.
thx
Knowing english is still really useful in this field
but what does it mean is it? how does it read file .-.
ooohhh
k k k
wait im understanding little bit i think
but problem is im not using console
what am i supposed to write there
and how can i save a picture?
i can save the title and path but how can i save picture?
s will containt a line at every iteration of the loop
btw i dont know "while"
i saw in my class but i didnt understand and im still dont understand
but i think i can use in sentence but i dont understand in code
https://www.merriam-webster.com/dictionary/while As long as the condition is true, execute the body
Definition of WHILE
a period of time especially when short and marked by the occurrence of an action or a condition : time; the time and effort used (as in the performance of an action) : trouble… See the full definition
ReadLine returns null when there are no more lines in the file so the loop ends
i always ending loops with if and else
because of that
You can do that but you should put the exit condition in the loop statement if you can for clarity
maybe i didnt saw loops 😄
i need to ask what is loop in coding?
Instead of do
damn i understand so fastly
i wasnt expect that
i have a question again
how can i save different datas
where am i supposed to place the code
wait im gonna try something if i dont make it i'll come back
it doesnt write anything
i made with no errors
but
because im a stupid
nah maybe im not
yeah its programs problem or maybe i wrote wrong there
anyway im going to sleep see you in the morning
@theboxybear can you just help me to finish this project?
i will learn it i promise but i need to finish it
Just try it. One part is converting the library to a string, then take that string and write to a file
The other part is doing it in reverse
I can help if you have issues on specific parts, just share your code and the exact issue you're having
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.