string l_strSelect;
int slength=l_strSelect.Length;

解决方案 »

  1.   

    在String中没有Byte呀 这个字节的问题我找了好几天了 能不能需要格式化串呢才能取得?
      

  2.   

    int a=32;
    取高位:a>>16
    取低位:a&0x0ffff搞定,还不送分吗?
      

  3.   

    Decode d=Encoding.UTF8.GetDecoder();
    d.GetChars(byData,0,byData.Length,cahrData,0)有用没的。
      

  4.   

    string和byte之间的关系要由Encoding决定的。比如说"abc你好",不算结尾的null字符的话:
    使用UTF8,可能是9个字节;使用unicode可能是10个字节;使用ANSI(结果是乱码)是7个字节...所以要用特定的Encoding把string转换成byte[],然后才能取得具体的byte数。