|
@@ -168,13 +168,13 @@ public class Xmlconfig
|
|
|
/// 解析并获取返回2个key的xml.
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
- public static bool Get2KeyInfoFromXml(string str, string key1, string key2, out string code, out string desc, out string value1, out string md51, out string value2, out string md52)
|
|
|
+ public static bool Get2KeyInfoFromXml(string str, string dataKey, string toolKey, out string code, out string desc, out string acaskey_data, out string acaskey_datamd5, out string acaskey_tool, out string acaskey_toolmd5)
|
|
|
{
|
|
|
- md51 = "";
|
|
|
- md52 = "";
|
|
|
+ acaskey_data = "";
|
|
|
+ acaskey_tool = "";
|
|
|
code = "";
|
|
|
- value1 = "";
|
|
|
- value2 = "";
|
|
|
+ acaskey_datamd5 = "";
|
|
|
+ acaskey_toolmd5 = "";
|
|
|
try
|
|
|
{
|
|
|
XmlDocument xml = new XmlDocument();
|
|
@@ -183,33 +183,33 @@ public class Xmlconfig
|
|
|
desc = xml.SelectSingleNode("response").Attributes.GetNamedItem("desc").InnerText;
|
|
|
if (code == "200")
|
|
|
{
|
|
|
- value1 = xml.SelectSingleNode("response//" + key1).Attributes.GetNamedItem("value").InnerText;
|
|
|
- if (xml.SelectSingleNode("response//" + key1).Attributes.GetNamedItem("md5value") != null)
|
|
|
- md51 = xml.SelectSingleNode("response//" + key1).Attributes.GetNamedItem("md5value").InnerText;
|
|
|
+ acaskey_data = xml.SelectSingleNode("response//" + dataKey).Attributes.GetNamedItem("value").InnerText;
|
|
|
+ if (xml.SelectSingleNode("response//" + dataKey).Attributes.GetNamedItem("md5value") != null)
|
|
|
+ acaskey_datamd5 = xml.SelectSingleNode("response//" + dataKey).Attributes.GetNamedItem("md5value").InnerText;
|
|
|
|
|
|
bool bCRC321 = false;
|
|
|
string CRC321 = "";
|
|
|
- if (xml.SelectSingleNode("response//" + key1).Attributes.GetNamedItem("crc32") != null)
|
|
|
+ if (xml.SelectSingleNode("response//" + dataKey).Attributes.GetNamedItem("crc32") != null)
|
|
|
{
|
|
|
bCRC321 = true;
|
|
|
- CRC321 = xml.SelectSingleNode("response//" + key1).Attributes.GetNamedItem("crc32").InnerText;
|
|
|
+ CRC321 = xml.SelectSingleNode("response//" + dataKey).Attributes.GetNamedItem("crc32").InnerText;
|
|
|
}
|
|
|
|
|
|
- value2 = xml.SelectSingleNode("response//" + key2).Attributes.GetNamedItem("value").InnerText;
|
|
|
- if (xml.SelectSingleNode("response//" + key2).Attributes.GetNamedItem("md5value") != null)
|
|
|
- md52 = xml.SelectSingleNode("response//" + key2).Attributes.GetNamedItem("md5value").InnerText;
|
|
|
+ acaskey_tool = xml.SelectSingleNode("response//" + toolKey).Attributes.GetNamedItem("value").InnerText;
|
|
|
+ if (xml.SelectSingleNode("response//" + toolKey).Attributes.GetNamedItem("md5value") != null)
|
|
|
+ acaskey_toolmd5 = xml.SelectSingleNode("response//" + toolKey).Attributes.GetNamedItem("md5value").InnerText;
|
|
|
|
|
|
bool bCRC322 = false;
|
|
|
string CRC322 = "";
|
|
|
- if (xml.SelectSingleNode("response//" + key2).Attributes.GetNamedItem("crc32") != null)
|
|
|
+ if (xml.SelectSingleNode("response//" + toolKey).Attributes.GetNamedItem("crc32") != null)
|
|
|
{
|
|
|
bCRC322 = true;
|
|
|
- CRC322 = xml.SelectSingleNode("response//" + key2).Attributes.GetNamedItem("crc32").InnerText;
|
|
|
+ CRC322 = xml.SelectSingleNode("response//" + toolKey).Attributes.GetNamedItem("crc32").InnerText;
|
|
|
}
|
|
|
|
|
|
if (bCRC321)
|
|
|
{
|
|
|
- if (CrcUtils.CRC32(value1) != Convert.ToUInt32(CRC321, 16))
|
|
|
+ if (CrcUtils.CRC32(acaskey_data) != Convert.ToUInt32(CRC321, 16))
|
|
|
{
|
|
|
desc = "CRC32 error";
|
|
|
return false;
|
|
@@ -218,7 +218,7 @@ public class Xmlconfig
|
|
|
|
|
|
if (bCRC322)
|
|
|
{
|
|
|
- if (CrcUtils.CRC32(value2) != Convert.ToUInt32(CRC322, 16))
|
|
|
+ if (CrcUtils.CRC32(acaskey_tool) != Convert.ToUInt32(CRC322, 16))
|
|
|
{
|
|
|
desc = "CRC32 error";
|
|
|
return false;
|