void Test()
{
XElement root = XElement.Parse("<book></book>");
string a = "1";
test2(root, a);
Response.Write(root.ToString());
Response.Write(a);
}
void test2(XElement root, string a)
{
a += "1";
root.SetAttributeValue("name", "cpp");
}
输出的是:<book name="cpp"></book>1
为什么root的值变了,而a的值没变?
侃侃尔雅
大话西游666
随时随地看视频慕课网APP