private void textBox3_TextChanged(object sender, EventArgs e) { string hexStr = (sender as TextBox).Text.Trim().Replace(" ", ""); byte[] data = Byter.HexToBytes(hexStr); // 解析16进制数据为byte Byter byter = new Byter(data); // 数据转码 textBox4.Text = checkBox1.Checked ? byter.ToString() : byter.ToString2(); }
/// <summary> /// 获取Field对应数据的所有Byter解析信息 /// </summary> /// <param name="fieldName"></param> /// <returns></returns> public string GetField_ByterStr(string fieldName) { byte[] data = GetFieldBytes(fieldName); // 获取field对应数据 Byter byter = new Byter(data); // 对数据进行解析 if (fieldName.StartsWith("@Ex_")) { return(byter.ToString2()); } return(byter.ToString()); }