unity3d读写XML
来源:互联网 发布:下载billboard软件 编辑:程序博客网 时间:2024/05/22 08:28
string ReadVersion() //从本地配置文件中读取版本信息
{
WebClient wc = new WebClient();
XmlDocument doc = new XmlDocument();
#if UNITY_ANDROID
string path = GetFilePath("","1")+"/version.xml";
#else
string path = GetFilePath("","0")+"/version.xml";
#endif
if(File.Exists(path))
{
doc.Load(path);
wc = null;
return doc.SelectSingleNode("version").InnerText;
}
return "";
}
void WriteVersion(string version) //修改本地配置文件中的版本信息
{
WebClient wc = new WebClient();
XmlDocument doc = new XmlDocument();
#if UNITY_ANDROID
string path = GetFilePath("","1")+"/version.xml";
#else
string path = GetFilePath("","0")+"/version.xml";
#endif
if(File.Exists(path))
{
doc.Load(path);
XmlNode node = doc.SelectSingleNode("version");
XmlText text = doc.CreateTextNode(version);
node.AppendChild(text); //node.innerText = version
doc.Save(path);
}
wc = null;
}
{
WebClient wc = new WebClient();
XmlDocument doc = new XmlDocument();
#if UNITY_ANDROID
string path = GetFilePath("","1")+"/version.xml";
#else
string path = GetFilePath("","0")+"/version.xml";
#endif
if(File.Exists(path))
{
doc.Load(path);
wc = null;
return doc.SelectSingleNode("version").InnerText;
}
return "";
}
void WriteVersion(string version) //修改本地配置文件中的版本信息
{
WebClient wc = new WebClient();
XmlDocument doc = new XmlDocument();
#if UNITY_ANDROID
string path = GetFilePath("","1")+"/version.xml";
#else
string path = GetFilePath("","0")+"/version.xml";
#endif
if(File.Exists(path))
{
doc.Load(path);
XmlNode node = doc.SelectSingleNode("version");
XmlText text = doc.CreateTextNode(version);
node.AppendChild(text); //node.innerText = version
doc.Save(path);
}
wc = null;
}
0 0
- Unity3D 读写XML文件
- Unity3D 读写XML文件
- Unity3D C# 读写XML
- Unity3d 读写XML文件
- unity3d读写XML
- unity3d读写XML文件
- unity3d XML配置表读写
- Unity3d如何读写XML文件
- unity3d 简单的xml文件读写操作
- 读写XML
- 读写XML
- 读写XML
- 读写XML
- 读写XML
- xml读写
- XML读写
- 读写XML
- XML读写
- lcx源代码以及免杀的研究
- SQL Server 2008数据库表中修改字段的数据类型后,不能保存
- android中的颜色设置(转)
- 制作grub磁盘流程
- 浅谈HTTP中Get与Post的区别
- unity3d读写XML
- 121、forward 和redirect的区别
- ORA-01033:ORCLE initialization or shutdown in progress问题的解决
- Hibernate优化
- 什么才是真正的人才
- 去除Excel工作表保护密码
- 【STM32F4探索套件】序列之3:按键FIFO机制
- Java Object Interning
- Servlet图片加水印