I'm trying to convert a string to ASCII and I added one button of convert to ASCII and 2 text boxes:
example of what should I need to get: for input text@gg.com I need to get: 116 101 120 116 064 103 103 046 099 111 109 for some reason I always get 78-74-40-67-67-2E-63-6F-6D
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace ascii
{
public partial class WebForm1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void TextBox1_TextChanged(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
foreach (char c in TextBox1.Text)
{
TextBox3.Text = Encoding.ASCII.GetString(new byte[] { });
}
}
protected void TextBox3_TextChanged(object sender, EventArgs e)
{
}
}
}
Thank you a lot for the help!