日期:2014-05-18  浏览次数:20865 次

C# 如何反序列化这个类 XmlDispatchReply.Deserialize

Class1 {
   
  private string msg1StatusField;
   
  private Class2 reply_dispatchesField;
}

Class2 {
   
  private string msg1StatusField;
   
  private Class3[] reply_dispatchesField;
}
Class3
{
  private string dispatchNumberField;
}

Xmlfiel:
  - <SB_DispatchSubStatusUpdateReply> //class1
  <MsgStatus>NORMAL</MsgStatus> 
- <Dispatches> /class2
- <Dispatch> //class3
  <DispatchNumber>11111</DispatchNumber> 
  </Dispatch>
- <Dispatch>
  <DispatchNumber>22222</DispatchNumber> 
  </Dispatch>
- <Dispatch>
  <DispatchNumber>33333</DispatchNumber> 
  </Dispatch>
- <Dispatch>
  <DispatchNumber>44444</DispatchNumber> 
  </Dispatch>
- <Dispatch>
  <DispatchNumber>55555</DispatchNumber> 
  </Dispatch>
 </Dispatches>
</SB_DispatchSubStatusUpdateReply>


------解决方案--------------------
可序列化吗?
------解决方案--------------------
我也是的怎么看都不能可序列化呀?

------解决方案--------------------

------解决方案--------------------
进来之前对“反序列化”很感兴趣的,见到楼主的网名,一点思路都没了,还是走吧...
------解决方案--------------------
先看看
------解决方案--------------------
声明可序列化 然后就用XmlSerializer呗