//获得字节长度

private int getLengthb(string str)  

  •         {  
  •             return System.Text.Encoding.Default.GetByteCount(str);  
  •         }  
原文地址:https://www.cnblogs.com/DTWolf/p/4670428.html