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;
}