我可以用套接字發送一個簡單的文本給我的客戶端。但是,我怎樣才能將數組,IList或Class發送到我的客戶端。我想給這個格式C#用套接字發送IList
Product= car, Price = 1
Product= pencil, Price = 2
後,我想顯示這個集合在我gridview
這樣
Product Price
Car 1
pencil 2
感謝您的意見
問候
我可以用套接字發送一個簡單的文本給我的客戶端。但是,我怎樣才能將數組,IList或Class發送到我的客戶端。我想給這個格式C#用套接字發送IList
Product= car, Price = 1
Product= pencil, Price = 2
後,我想顯示這個集合在我gridview
這樣
Product Price
Car 1
pencil 2
感謝您的意見
問候
你需要決定基本上是一個序列化格式。例如:
有很多選擇......你需要根據你的要求來決定(例如, G。版本化你的數據結構,緊湊性,多平臺vs .NET等)。
最終,它是所有字節 - 您需要決定如何在這些字節中表示您的數據。
*咳嗽*聰明的產品安置:) – 2011-03-31 12:34:22
首先感謝您的答案。你能看到任何演示或示例標準「.NET二進制序列化?再次感謝 – emozguner 2011-03-31 12:39:16
@Albert:請參閱http://msdn.microsoft.com/en-us/library/72hyey7b(v=VS.100).aspx – 2011-03-31 12:40:05
什麼插座?你使用TcpClient,WebClient,原始插座... – Aliostad 2011-03-31 12:30:00