如何将内存中的数组写入到硬盘
比如有一个double数组,如何将其存到硬盘?
------解决方案--------------------爱怎么写怎么写,这个没有什么标准
------解决方案--------------------正常写就行
------解决方案--------------------用系列化就可以了!!
------解决方案--------------------消息 队列服务
------解决方案--------------------为什么不用序列化呢?
------解决方案--------------------使用XmlSerializer   
 using System.Xml.Serialization;   
 然后假设你的对象类型是MyObject,实例是myObject1   
 XmlSerializer xs = new XmlSerializer(typeof(MyObject)); 
 Stream stream = null; 
 xs.Serialize(stream, myObject1);   
 这样stream里存放的就是你的对象经过序列化以后的值
------解决方案--------------------使用文件流直接写硬盘就好了FileStream
------解决方案--------------------TO:现在是有一个很长很长的链表,不能直接序列化这个链表,但是要把这个链表的结果存在一个文件里   
 你可以将链表中的对象一个个依次序列化到文件中...   
 反序列化也一样,一个个再回来..
------解决方案--------------------TO:我狂晕,不是double数组吗,怎么又变成对象链表了 
 没见过这样问问题的!     
 用户需求突变,这是允许的..   
 呵呵..
------解决方案--------------------//将一个对象序列化成二进制数组 
         private byte[] SerializeToByte(ArrayList list) 
         { 
             //假如Arraylist为空,则返回null 
             if (list.Count == 0) 
             { 
                 return null; 
             } 
             byte[] array = null; 
             try 
             { 
                 //定义一个流 
                 Stream stream = new MemoryStream(); 
                 //定义一个格式化器 
                 BinaryFormatter bf = new BinaryFormatter(); 
                 //将Arraylist中的对象逐一进行序列化 
                 foreach (object obj in list) 
                 { 
                     bf.Serialize(stream, obj); 
                 } 
                 array = new byte[stream.Length]; 
                 //将二进制流写入数组 
                 stream.Position = 0; 
                 stream.Read(array, 0, (int)stream.Length); 
                 //关闭流 
                 stream.Close(); 
             } 
             catch (Exception ex) 
             { 
                 MessageBox.Show(ex.Message); 
                 return null; 
             } 
             return array; 
         }   
         //将一个二进制数组反序列化 
         private ArrayList DeseralizeToArraylist(byte[] b) 
         { 
             if (b == null || b.Length == 0) 
             { 
                 return null; 
             } 
             //定义一个流 
             MemoryStream stream = new MemoryStream(b); 
             //定义一个格式化器 
             BinaryFormatter bf = new BinaryFormatter(); 
             ArrayList list = new ArrayList(); 
             while (stream.Position != stream.Length) 
             { 
                 list.Add(bf.Deserialize(stream)); 
             } 
             stream.Close(); 
             return list; 
         }   
------解决方案--------------------如果不能用序列化,试试这个:   
 using System; 
 using System.Collections.Generic; 
 using System.Text; 
 using System.Xml; 
 using System.IO; 
 using System.Reflection; 
 using System.Runtime.Serialization; 
 using System.Collections;   
 namespace Convert