deluvas
deluvas
CC#
Created by daveeska on 3/10/2023 in #help
❔ 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 path
46 replies
CC#
Created by daveeska on 3/10/2023 in #help
❔ Failed reading a file
C:/temp/ChatTe/ChatList/usrcount.txt there was a t missing in ChatTe
46 replies
CC#
Created by Sh1be on 12/21/2022 in #help
✅ System.Text.Json serialization problem
var serializeOptions = new JsonSerializerOptions
{
WriteIndented = true,
Converters =
{
new DateTimeOffsetJsonConverter()
}
};

jsonString = JsonSerializer.Serialize(weatherForecast, serializeOptions);
var serializeOptions = new JsonSerializerOptions
{
WriteIndented = true,
Converters =
{
new DateTimeOffsetJsonConverter()
}
};

jsonString = JsonSerializer.Serialize(weatherForecast, serializeOptions);
do you also tell your jsonserializer to use that converter?
222 replies
CC#
Created by Sh1be on 12/21/2022 in #help
✅ 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
CC#
Created by idris_2020 on 12/8/2022 in #help
✅ I am trying to output a 2D array to a datagridview, but it is not outputting correctly
because you used seat[x] instead seat[y] as indexer ^^
9 replies
CC#
Created by Tim on 10/21/2022 in #help
System.Text.Json.Serialize returns emtpy map
your properties aren't public, therefor JsonSerializer ignores them
3 replies
CC#
Created by Kaoruko Waguri on 10/12/2022 in #help
Not sure what I'm doing wrong but my Total Fare is messed up [Answered]
Because you add 2 times bookingFeeX instead baseFare
59 replies