解决方案 »

  1.   

    参照:
    http://www.cnblogs.com/yukaizhao/archive/2011/07/22/xml-serialization.html
      

  2.   

    引用,using System.Xml.Linq;
      

  3.   

    界面值--->ArrayList保存-->xml属于序列化过程
    xml-->ArrayList---->界面 属于反序列化过程 
      

  4.   

    Arraylist里能放二维数组?
    只能是一维的吧...
      

  5.   

    试了一下,真的可以
    al.add(new string[]{"1","2","3"});
      

  6.   

    嗯,反过来的方式不应该是反序列化过程吗?
    写入ArrayList中是这样的arr[0]、arr[1]、arr[2].....arr[1]:arr[2]:
      

  7.   


    IEnumerable<XElement> ConfigNode = Config.Element();  //Config.Element()参数为0,报错的
    error cs1501: no overload for method 'Element takes '0''arguments 
      

  8.   


    IEnumerable<XElement> ConfigNode = Config.Element();  //Config.Element()参数为0,报错的
    error cs1501: no overload for method 'Element takes '0''arguments 
    麻烦看清楚,是Elements()不是Element();
      

  9.   


    IEnumerable<XElement> ConfigNode = Config.Element();  //Config.Element()参数为0,报错的
    error cs1501: no overload for method 'Element takes '0''arguments 
    麻烦看清楚,是Elements()不是Element();不好意思哈,看错了这个我又哪错了?
      

  10.   


    IEnumerable<XElement> ConfigNode = Config.Element();  //Config.Element()参数为0,报错的
    error cs1501: no overload for method 'Element takes '0''arguments 
    麻烦看清楚,是Elements()不是Element();
    temStr = null; 将其清空
      

  11.   

    你到底是想用集合,还是直接放字符串里逗号分隔?
    如果是逗号分隔
    if(tempStr.Length>0)
    {
    tempStr+=",";
    }
    tempStr+=nodeValue;
      

  12.   


    <?xml version="1.0" encoding="utf-8"?>
    <Configs>
      <Config StoreName="999">
        <StoreTime>888</StoreTime>
        <StoreMaxCount>777</StoreMaxCount>
        <StoreCondition>2525</StoreCondition>
      </Config>
      <Config StoreName="528">
        <StoreTime>147</StoreTime>
        <StoreMaxCount>1471</StoreMaxCount>
        <StoreCondition>1321</StoreCondition>
      </Config>
      <Config StoreName="369">
        <StoreTime>258</StoreTime>
        <StoreMaxCount>457</StoreMaxCount>
        <StoreCondition>12</StoreCondition>
      </Config>
      <Config StoreName="369">
        <StoreTime>258</StoreTime>
        <StoreMaxCount>457</StoreMaxCount>
        <StoreCondition>12</StoreCondition>
      </Config>
    </Configs>根据这个xml文件,我是想把这
     <Config StoreName="999">
        <StoreTime>888</StoreTime>
        <StoreMaxCount>777</StoreMaxCount>
        <StoreCondition>2525</StoreCondition>
      </Config>
    这一个节点的信息放在arr[0] 动态数组中保存,下一个节点放在arr[1]中保存
    然后在arr[0]中包含StoreName、StoreTime、StoreMaxCount、StoreCondition这些信息