【发布时间】:2019-10-09 12:33:21
【问题描述】:
假设我们有这样的代码:
string actualvalue = "<a>";
string abc = "<firstnode><secondnode abc=\""+ actualvalue + "\"></secondnode></firstnode>";
XElement item2 = XElement.Parse(abc);
foreach (var item in item2.Descendants("secondnode"))
{
string aftergettingitfromXlement = item.Attribute("abc").Value;
///so aftergettingitfromXlement = "<a>" which is not correct i want to have actual value which is encoded
}
知道如何获得实际值,我不想再次编码。为什么编码丢失了?
【问题讨论】: