byte[] test = Form1.StrToByteArray("simpletext"); string encoded_text = BitConverter.ToString(test).Replace("-", "").ToLowerInvariant(); textBox1.Text = encoded_text;//73696d706c6574657874
as from this line "73696d706c6574657874" to get back "simpletext" ??
//StrToByteArray()
public static byte[] StrToByteArray(string str)
{
System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding();
return encoding.GetBytes(str);
}