private float ReadFloat(string s, float defaultVal) { try { return Convert.ToSingle(s); } catch (FormatException) { return defaultVal; } }