有人可以帮助我,我有这个xml片段
原文链接:https://www.f2er.com/xml/293051.html<?xml version="1.0" encoding="utf-8" ?> <EmailConfiguration> <DataBoxID>123</DataBoxID> <DefaultSendToAddressCollection> <EmailAddress>email@whereEver.com</EmailAddress> </DefaultSendToAddressCollection> </EmailConfiguration>
我想从中创建一个corressponding c#类.在您说“只使用xsd.exe”之前,Xsd的输出无法序列化和反序列化正确,因为它使用部分类生成类.
请问你能告诉我如何创建这个类….这是我采取的方法,但它不起作用.
public class EmailConfiguration { private string dataBoxID; public string DataBoxID { get { return dataBoxID; } set { dataBoxID = value; } } private DefaultSendToAddressCollectionClass defaultSendToAddressCollection; public DefaultSendToAddressCollectionClass DefaultSendToAddressCollection { get { return defaultSendToAddressCollection; } set { defaultSendToAddressCollection = value; } } }
这是子类的类声明
public class DefaultSendToAddressCollectionClass { private string[] emailAddress; public string[] EmailAddress { get { return emailAddress; } set { emailAddress = value; } } }