byte [] myData= new byte [0];
myData = (byte[]) m;

解决方案 »

  1.   

    怎么将ushort或uint或int或long类型转换成Byte[]?????????????
      

  2.   

    C#里除了Convert里面有类型转换,哪里还可以进行类型的转化?????
      

  3.   

    To wangchinaking(助人为乐是快乐之本):你参考一下这个例子:http://groups.google.com/groups?selm=%237tARJk5BHA.1656%40tkmsftngp05
      

  4.   

    1. You may find what you need in BitConverter class.
    2. Yes, I agree with poetc(伊公子). Serialization is still the best choice.
      

  5.   

    [Serialize]
    public struct mystruct
    {
      public int a;
      public byte b;
      public string c;
      public long d;
    }