Advertisement
Guest User

Untitled

a guest
Aug 28th, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.57 KB | None | 0 0
  1. namespace WindowsFormsApplication2
  2. {
  3.     public partial class Form1 : Form
  4.     {
  5.         public Form1()
  6.         {
  7.             InitializeComponent();
  8.         }
  9.         private void textBox2_TextChanged(object sender, EventArgs e)
  10.         {
  11.             textBox2.ReadOnly = true;
  12.         }
  13.  
  14.         private void button1_Click(object sender, EventArgs e)
  15.         {
  16.             var s = textBox1.Text;
  17.             byte[] bytes = Encoding.ASCII.GetBytes(s);
  18.             var result = BitConverter.ToInt32(bytes, 0);
  19.             textBox2.Text = result;
  20.         }
  21.  
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement