我正在尝试从 c# 中的列表中获取字符串,但找不到方法。这是我的代码
public class CurrentCondition
{
public string cloudcover { get; set; }
public string humidity { get; set; }
public string observation_time { get; set; }
public string precipMM { get; set; }
public string pressure { get; set; }
public string temp_C { get; set; }
public string temp_F { get; set; }
public string visibility { get; set; }
public string weatherCode { get; set; }
public List<WeatherDesc> weatherDesc { get; set; }
public List<WeatherIconUrl> weatherIconUrl { get; set; }
public string winddir16Point { get; set; }
public string winddirDegree { get; set; }
public string windspeedKmph { get; set; }
public string windspeedMiles { get; set; }
}
public class Data
{
public List<CurrentCondition> current_condition { get; set; }
}
例如,我想从列表中获取temp_F
字符串。current_condition
我怎样才能做到这一点?