Can’t open file with File.Open/File.OpenRead.
System sees that file exists, but the FileNotFoundException is thrown when it tries to read file.
Here’s the code:
if (File.Exists(@"D:\records.dat"))
{
using (Stream str = File.OpenRead(@"D:\records.dat"))
{
Records = (scoreboardContainer)Bf.Deserialize(stream);
}
}
else Debug.Log("file not exists");
Need an advice, how to fix this.