/// <summary>
       /// 将字符串转换为字节
       /// </summary>
       /// <param name="str"></param>
       /// <returns></returns>
       public static byte[] StrToBytes(string str)
       {
           MemoryStream ms = new MemoryStream();
           StreamWriter outerstr = new StreamWriter(ms, System.Text.Encoding.GetEncoding("GB2312"));           outerstr.Write(str);
           outerstr.Flush();
           ms.Position = 0;
           byte[] bts = new byte[ms.Length];           ms.Read(bts, 0, bts.Length);           outerstr.Close();
           ms.Close();           return bts;
       }