C# kód :
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Diagnostics; namespace ASCIIto { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void ASCIItoHEX(string ASCIData ,out string HEXdata) { HEXdata = String.Empty; byte[] temp; try { temp = ASCIIEncoding.ASCII.GetBytes(ASCIData); foreach (byte b1 in temp) { HEXdata += b1.ToString("X") + " "; } } catch { } } private void ASCIItoDEC(string ASCIIData, out string DECdata) { DECdata = String.Empty; byte[] temp; try { temp = ASCIIEncoding.ASCII.GetBytes(ASCIIData); foreach (byte b1 in temp) { DECdata += b1.ToString() + " "; } DECdata.TrimEnd(' '); } catch { } } private void DECtoASCII(string DECdata,out string ASCIIData ) { ASCIIData = String.Empty; string[] temp; try { temp = DECdata.Split(new string[] { " " }, StringSplitOptions.None); foreach (string b1 in temp) { ASCIIData += ((char)Convert.ToInt16(b1)).ToString(); } } catch { } } private void HEXtoASCII(string HEXdata, out string ASCIIData) { ASCIIData = String.Empty; string[] temp; try { temp = HEXdata.Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries); foreach (string b1 in temp) { ASCIIData += ((char)Convert.ToInt16(b1,16)).ToString(); } } catch { } } private void textBox2_KeyUp(object sender, KeyEventArgs e) { string HEXdata = String.Empty; string DECdata = this.textBox2.Text; string ASCIIdata = String.Empty; this.DECtoASCII(DECdata, out ASCIIdata); this.textBox1.Text = ASCIIdata; this.ASCIItoHEX(ASCIIdata, out HEXdata); this.textBox3.Text = HEXdata; } private void textBox1_KeyUp(object sender, KeyEventArgs e) { string HEXdata = String.Empty; string DECdata = String.Empty; string ASCIIdata = this.textBox1.Text; this.ASCIItoHEX(ASCIIdata, out HEXdata); this.ASCIItoDEC(ASCIIdata, out DECdata); this.textBox3.Text = HEXdata; this.textBox2.Text = DECdata; } private void textBox3_KeyUp(object sender, KeyEventArgs e) { string HEXdata = this.textBox3.Text; string DECdata = String.Empty; string ASCIIdata = String.Empty; this.HEXtoASCII(HEXdata, out ASCIIdata); this.textBox1.Text = ASCIIdata; this.ASCIItoDEC(ASCIIdata, out DECdata); this.textBox2.Text = DECdata; } private void label4_Click(object sender, EventArgs e) { Process.Start(@"http://www.projectik.eu"); } private void textBox3_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar >= '0' && e.KeyChar <= '9' || e.KeyChar >= 'a' && e.KeyChar <= 'f' || e.KeyChar >= 'A' && e.KeyChar <= 'F' || e.KeyChar == ' ' || e.KeyChar == '\b') e.Handled = false; else e.Handled = true; } private void textBox2_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar >= '0' && e.KeyChar <= '9'|| e.KeyChar == ' ' || e.KeyChar == '\b') e.Handled = false; else e.Handled = true; } } }