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 吧???
这个你自己看着办。
{
char cmd='t';
int size=4;
int check=1;
bw.Write(cmd);
bw.Write(size);
bw.Write(check);
}不过。。?
C的int好象对应 dotNet 的 Int16 吧???
这个你自己看着办。
C的char好象是 dotNet的 byte ??这个不清楚了。。-----
如果要读,那么反过来。
用BinaryReader
你怎样使用BinaryReader啊???
用在用于发送的Stream中??例子是,当你接收到对方送过来的信息,你才好用BinaryReader