Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在隔离存储中有 xml 文件。附上快照。我有两个问题
请给我这两个问题的代码。
您可以XDocument用来解析 XML 文件:
XDocument
XDocument doc = XDocument.Load("PATH/TO/YOUR/INPUT"); var v = doc.Descendants("imageTime").ToArray();
然后到,
1- 读取第一个imageTime元素:
string value = v[0].Value;
2-修改第三个imageTime元素:
v[2].Value = "yourNewValue";