1
大家好我是通過解析器閱讀XMLDATA
我收到錯誤,如讀取數據作爲xmlElemet ..「\ B」,十六進制值0x08時,是無效字符
我讀這個字符串.. 謝謝..
XElement xParser = null;
string sPwd = null;
string sKey1 = null;
string sKey2 = null;
System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding();
string soutxml = "";
soutxml = encoding.GetString(sEncData);
xParser = XElement.Parse(soutxml);
IEnumerable<XElement> elemsValidations =
from el in xParser.Elements("EmailPwd")
select el;
foreach (XElement elemValidation in elemsValidations)
{
sPwd = elemValidation.Element("EncPwd").Value;
sKey1 = elemValidation.Element("Key1").Value;
sKey2 = elemValidation.Element("Key2").Value;
}
byte[] Key1 = encoding.GetBytes(sKey1);
byte[] Key2 = encoding.GetBytes(sKey2);
byte[] Data = encoding.GetBytes(sPwd);
// Decrypt the buffer back to a string.
string Final = DecryptTextFromMemory(Data, Key1, Key2);
return Final;
該數據是實際的數據輸出..
- <EmailPwd>
- <EncPwd>
- <![CDATA[ [email protected]]Z
]]>
</EncPwd>
- <Key1>
- <![CDATA[ ~??s????E&?3??2?3I?????
]]>
</Key1>
- <Key2>
- <![CDATA[ ???h?6
]]>
</Key2>
</EmailPwd>
哪裏是字符串?你使用哪個解析器?任何代碼示例? – Kangkan 2010-05-06 05:29:14
我會送你一些前。我讀這個數據只是看我的代碼 – 2010-05-06 06:26:10