C#中如何将字符串转换成流,同时如何将流转换成字符串? dodo

1   string   to   byte  
  string   str   =   "your   string"   ;  
  byte[]   bytes   =   System.Text.Encoding.ASCII.GetBytes(str);  
   
  2   bytes   to   string  
   
  byte[]   bytes   =   new   byte[255]   ;  
  ......  
  string   str   =   System.Text.Encoding.ASCII.GetString(bytes,0,bytes.Length);  
   
  还可以用其他编码     UTF7,UTF8,Unicode   等
原文地址:https://www.cnblogs.com/zgqys1980/p/758602.html