读取/保存xml文件的类(序列化/反序列化)
1
2using System;
3using System.Collections.Generic;
4using System.Text;
5using System.Xml.Serialization;
6using System.IO;
7using System.Reflection;
8
9namespace Mobile.Services
10{
11 /// <summary>
12 /// 读取/保存xml文件的类
13 /// </summary>
14 public class XmlService
15 {
16 private string _strPath;
17
18 public XmlService()
19 {
20 //this._strPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetName().CodeBase + "\\SysSetting.xml");
21 }
22
23
24 /// <summary>
25 /// 持久化文件路径
26 /// </summary>
27 public string XMLPath
28 {
29 get { return _strPath; }
30 set { _strPath = value; }
31 }
32
33 公有方法/属性
112
113 }
114}
115
2using System;
3using System.Collections.Generic;
4using System.Text;
5using System.Xml.Serialization;
6using System.IO;
7using System.Reflection;
8
9namespace Mobile.Services
10{
11 /// <summary>
12 /// 读取/保存xml文件的类
13 /// </summary>
14 public class XmlService
15 {
16 private string _strPath;
17
18 public XmlService()
19 {
20 //this._strPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetName().CodeBase + "\\SysSetting.xml");
21 }
22
23
24 /// <summary>
25 /// 持久化文件路径
26 /// </summary>
27 public string XMLPath
28 {
29 get { return _strPath; }
30 set { _strPath = value; }
31 }
32
33 公有方法/属性
112
113 }
114}
115
为成功找方法,不为失败找借口!
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步