数组列表到内存流C# [英] arraylist to memorystream c#
本文介绍了数组列表到内存流C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Hiii全部...
我有一个用户定义数据类型的arraylist ...
我需要通过局域网发送它.
我正在使用WCF进行通信,我知道我必须将arraylist转换为memorystream才能发送数据...
我尝试过这种方法
Hiii all...
I have an arraylist with user define data type...
and i need to send it trough LAN.
I am using WCF for communication and I know I have to convert arraylist to memorystream to send data...
I hve tried this method
ArrayList history = ie.getHistory();
BinaryFormatter f = new BinaryFormatter();
MemoryStream ms = new MemoryStream();
f.Serialize(ms, history);
但由于用户定义数据类型,我给出了错误...
帮助
感谢
but I gives error because of user define data type...
help
thanks
推荐答案
您是否为数据传输数组内容应用了序列化属性
Did you apply the serialization attribute for the data transfer array content
[Serializable]
这篇关于数组列表到内存流C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文