[System.Xml.Serialization.XmlRootAttribute("onlytest", Namespace="", IsNullable=false)]
public class onlytest {
/// <res/>
[System.Xml.Serialization.XmlElementAttribute("Test")]
public Test[] test;
/// <res/>
[System.Xml.Serialization.XmlAttributeAttribute("test1")]
public string test1;
}这里方括号的东西是什么呀。
到底坐什么用的
我原来学C++的
没用过C#
不知道上面中括号的东西到底要干什么。请大家帮忙解释解释
public class onlytest {
/// <res/>
[System.Xml.Serialization.XmlElementAttribute("Test")]
public Test[] test;
/// <res/>
[System.Xml.Serialization.XmlAttributeAttribute("test1")]
public string test1;
}这里方括号的东西是什么呀。
到底坐什么用的
我原来学C++的
没用过C#
不知道上面中括号的东西到底要干什么。请大家帮忙解释解释
XmlAttributeAttribut屬於是.net自帶的特性.
英文是什么呢?
他放在这里干什么用呢
把onlytest对象串行化为xml是设定它的根元素为root
....
详细解释参考 msdn 搜索XmlRootAttribute