的名单我有一个XML是高达20 MB:阅读高达20 MB大小的XML并将其分配给
<Neighborhood>
<Code LocationID='27767' NeighborhoodName='Broadway-Times Square' Latitude='40.7586' Longitude='-73.988152'/>
<Code LocationID='27767' NeighborhoodName='Midtown East' Latitude='40.755645' Longitude='-73.967428'/>
</Neighborhood>
我想读取XML和创建类的列表。
类如下:
public class HotelNeighbourhood
{
public int LocationID { get; set; }
public string NeighborhoodName { get; set; }
public float Latitude { get; set; }
public float Longitude { get; set; }
}
我想在最快的方式创建一个列表。 在此先感谢。
下一次,请格式化更敏感。 –
有关您编写的代码问题的问题必须描述特定的问题并包含有效的代码以进行重现。请参阅[SSCCE.org](http://sscce.org/)获取指导。 – DGibbs
请阅读:http://stackoverflow.com/questions/12931769/c-sharp-and-reading-large-xml-files和http://stackoverflow.com/questions/7671958/reading-large-xml-documents- in-net和http://stackoverflow.com/questions/468948/in-c-sharp-what-is-the-best-way-to-parse-large-xml-size-of-1gb – Sabilv