public static void Main(string[] args) { var p = new MyProperties(); new FileInfo("p.txt").ToFields(p); Console.WriteLine("SleepCount: " + p.SleepCount); Console.WriteLine("SleepDuration: " + p.SleepDuration); }