输入命令:
xsd d:\TDDOWNLOAD\atom-author-link.xsd /c /language:C# /outputdir:d:\
含义:
将d:\TDDOWNLOAD\atom-author-link.xsd 架构 生成类 语言为C# 输出目录是d:\
把xml映射到生成的C#类:
[XmlSerializerFormat]
public LocHubOrder XMLMapOrder(string xml)
{
byte[] array = Encoding.ASCII.GetBytes(xml);
LocHubOrder LHOrder;
using (MemoryStream stream = new MemoryStream(array))
{
XmlSerializer serializer = new XmlSerializer(typeof(LocHubOrder));
stream.Seek(, SeekOrigin.Begin);
LHOrder = serializer.Deserialize(stream) as LocHubOrder;
}
return LHOrder;
}