xx

1   string   to   byte  []
  string   str   =   "abcd"  ;  
  byte[]   bytes   =   System.Text.Encoding.ASCII.GetBytes(str);   
   -------------------------------------------------------------------------------------------------------------
 2   byte[]   to   string  
   
  byte[]   bytes   =   new   byte[255]   ;   
   string   str   =   System.Text.Encoding.ASCII.GetString(bytes,0,bytes.Length);  
--------------------------------------------------------------------------------------------
posted on 2011-06-22 11:44  lock  阅读(204)  评论(0)    收藏  举报