回覆列表
  • 1 # 棠溪吖

    byte[]轉換為字串儲存,然後再轉回來

    byte[] bytes = System.Text.Encoding.Default.GetBytes("fadfasfasdf");

    string str = BitConverter.ToString(bytes);

    string s2 = BitConverter.ToString(bytes); // 82-C8-EA-17

    String[] tempAry = s2.Split("-");

    byte[] decBytes2 = new byte[tempAry.Length];

    for (int i = 0; i < tempAry.Length; i++)

    decBytes2[i] = Convert.ToByte(tempAry[i], 16);

    // decBytes2 same as bytes

    string s3 = Convert.ToBase64String(bytes); // gsjqFw==

    byte[] decByte3 = Convert.FromBase64String(s3);

  • 中秋節和大豐收的關聯?
  • 農業機械維修員指的是什麼?