C#C
C#3y ago
daveeska

❔ Failed reading a file

The code:

class Server { private string usrcLoc; private int totalUsrs; private void init() { string usercount = usrcLoc; if (File.Exists(usercount)) { totalUsrs = int.Parse(File.ReadAllText(usercount)); } else { Console.WriteLine("oof"); totalUsrs = 0; } } public Server() { usrcLoc = @"C:\temp\ChaTe\ChatList\usrcount.txt"; totalUsrs = 0; }
Was this page helpful?