❔ 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
TheBoxyBear
TheBoxyBear2y ago
What did you try so far and what do you need help with exactly?
ThєSαvícs ↝ darKSaviC
my program isnt saves any added games
TheBoxyBear
TheBoxyBear2y ago
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
ThєSαvícs ↝ darKSaviC
how can i do can you help me? im still learning C# on my own way
TheBoxyBear
TheBoxyBear2y ago
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.
TheBoxyBear
TheBoxyBear2y ago
W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.
TheBoxyBear
TheBoxyBear2y ago
To do proper serialization you also really need to make classes to model your data
ThєSαvícs ↝ darKSaviC
i swear i dont know how can i use them but i need to finish my project too and my first language isnt english
TheBoxyBear
TheBoxyBear2y ago
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
ThєSαvícs ↝ darKSaviC
i have 3 datas in program text, game's place and picture btw what is publisher wait
TheBoxyBear
TheBoxyBear2y ago
EA, Ubisoft, etc
ThєSαvícs ↝ darKSaviC
ok i understand i need to translate sometimes sorry about that soo how can i make that?
TheBoxyBear
TheBoxyBear2y ago
https://www.w3schools.com/cs/cs_files.php Look into the method for reading and writing text
W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.
TheBoxyBear
TheBoxyBear2y ago
Then just contruct a string when writing, deconstruct the string when reading
ThєSαvícs ↝ darKSaviC
i'll try but first i need to clean my glasses
TheBoxyBear
TheBoxyBear2y ago
Good eyesight is important SunglassesFluent
ThєSαvícs ↝ darKSaviC
i didnt understand anything is that normal?
TheBoxyBear
TheBoxyBear2y ago
It can take a while to figure out Files are hard
ThєSαvícs ↝ darKSaviC
no its problem about my english im still dont understand what the site saying
TheBoxyBear
TheBoxyBear2y ago
You can use a translator extension in your browser or go to the official docs in your language
TheBoxyBear
TheBoxyBear2y ago
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.
TheBoxyBear
TheBoxyBear2y ago
Knowing english is still really useful in this field
ThєSαvícs ↝ darKSaviC
but what does it mean is it? how does it read file .-.
ThєSαvícs ↝ darKSaviC
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?
TheBoxyBear
TheBoxyBear2y ago
s will containt a line at every iteration of the loop
ThєSαvícs ↝ darKSaviC
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
TheBoxyBear
TheBoxyBear2y ago
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
TheBoxyBear
TheBoxyBear2y ago
ReadLine returns null when there are no more lines in the file so the loop ends
ThєSαvícs ↝ darKSaviC
i always ending loops with if and else because of that
TheBoxyBear
TheBoxyBear2y ago
You can do that but you should put the exit condition in the loop statement if you can for clarity
ThєSαvícs ↝ darKSaviC
maybe i didnt saw loops 😄 i need to ask what is loop in coding?
TheBoxyBear
TheBoxyBear2y ago
Instead of
while (true)
{
if (condition)
break;
}
while (true)
{
if (condition)
break;
}
do
while (!condition)
{

}
while (!condition)
{

}
ThєSαvícs ↝ darKSaviC
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
TheBoxyBear
TheBoxyBear2y ago
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
Accord
Accord2y ago
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.
Want results from more Discord servers?
Add your server