We have a need to save some of our configuration items into files. I have been told this is for some localization features we are going to use. From what I have been told, it is much faster to read f开发者_如何转开发rom a binary file than a straight XML file. Is this true, and is it ideal to save xml data in binary format or is there another way I should save the data to pull it into my web application?
I would like to be able to read the data using LINQ or casting it as an object. Also, what is the best way to parse the file for sepecific data? Any suggestions would be greatly appreciated?
I would recommend using XML over binary simply because it's easier to work with. Binary is faster but I doubt you would notice that speed gain in your application, especially if you cache the values you read from the file.
The easiest way to parse the XML file would be to deserialize it to an object using the XmlSerializer class. This is absolutely the most painless way to parse XML in my opinion.
精彩评论