Hey everyone,
I encountered a problem which I was not able to find a solution to solve my issue. I want to use a JObject parsed from a .json file.
I used FileStreams and StreamReaders for that and got the error "C# filestreams could not be used" on login on the client side.
My code is:
public static JObject GetClothData(Sex sex)
{
string plainText = string.Empty;
using (FileStream fs = File.OpenRead($"Clothes{(sex == Sex.Male ? "M" : "F")}.json"))
{
using (StreamReader sw = new StreamReader(fs))
{
plainText = sw.ReadToEnd();
sw.Close();
}
fs.Close();
}
return JObject.Parse(plainText);
}
Is there anything to do in advance to allow filestreams or are there any workarounds? (e.g. in JS I can require a json file)
Thanks in advance!
Tim.