using(System.IO.BinaryWriter bw=new System.IO.BinaryWriter(yourStream))
{
   char cmd='t';
   int size=4;
   int check=1;
   bw.Write(cmd);
   bw.Write(size);
   bw.Write(check);
}不过。。?
C的int好象对应 dotNet 的 Int16 吧???
这个你自己看着办。

解决方案 »

  1.   

    是哦
    C的char好象是 dotNet的 byte ??这个不清楚了。。-----
    如果要读,那么反过来。
    用BinaryReader
      

  2.   

    写没有问题,但是读就有问题:未处理的“System.ArgumentException”类型的异常出现在 mscorlib.dll 中其他信息:流不可读。
      

  3.   

    。。
    你怎样使用BinaryReader啊???
    用在用于发送的Stream中??例子是,当你接收到对方送过来的信息,你才好用BinaryReader