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

代码出错了...序列化程序报错..
if (skt == null) return 0;
  System.Runtime.Serialization.Formatters.Binary.BinaryFormatter bf;
  bf = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();
  MemoryStream ms = new MemoryStream();
  Packet pk = new Packet();
  Head head = new Head();
  head.dwCommon = IPAddress.HostToNetworkOrder(SendCmd);
  head.dwBLength = IPAddress.HostToNetworkOrder(SendContent.Length);
  pk.Packhd = head;
  pk.buf = Encoding.ASCII.GetBytes(SendContent);
  bf.Serialize(ms, pk);
  byte[] sendbuf = ms.ToArray();
  return skt.Send(sendbuf);

------解决方案--------------------
JF
------解决方案--------------------
接分中

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