deluvas
❔ Failed reading a file
if you wanna use the directory from where the program was started (aka the working directory) you can use
usrcLoc = Path.Combine(Directory.GetCurrentDirectory, "usrcount.txt")
or if you want to make it based on the location of the program itself you can use
usrcLoc = Path.Combine(GetType().Assembly.Location, "usrcount.txt")
btw
depending on how you wanna use the program this could make things easier for you then hardcoding the path46 replies
✅ System.Text.Json serialization problem
https://learn.microsoft.com/en-us/dotnet/standard/serialization/system-text-json/converters-how-to?pivots=dotnet-7-0 you could write a own jsonconverter for that class and use it with the system.text.json jsonserializer, then you could handle yourself how you want it to behave
222 replies