Ejemplo n.º 1
0
 private void BtnResim_Click(object sender, EventArgs e)
 {
     using (OpenFileDialog o = new OpenFileDialog())
     {
         if (o.ShowDialog() == DialogResult.OK)
         {
             PaketYazici py = new PaketYazici();
             py.Write((ushort)Komutlar.Resim);
             py.YazResim(File.ReadAllBytes(o.FileName));
             byte[] data = py.ByteGetir();
             trm.Gonder(data, data.Length);
         }
     }
 }
Ejemplo n.º 2
0
 private void BtnMesaj_Click(object sender, EventArgs e)
 {
     if (txtMesaj.Text.Length != 0)
     {
         PaketYazici py = new PaketYazici();
         py.Write((ushort)Komutlar.Mesaj);
         py.Write(txtMesaj.Text);
         byte[] data = py.ByteGetir();
         trm.Gonder(data, data.Length);
     }
     else
     {
         MessageBox.Show("Lütfen tüm mesaj kısmını doldurunuz.");
     }
 }
Ejemplo n.º 3
0
 private void BtnNesne_Click(object sender, EventArgs e)
 {
     if (txtAdi.Text.Length != 0 && txtSoyadi.Text.Length != 0 && txtMesaj.Text.Length != 0 && txtDYili.Text.Length != 0)
     {
         Kisi        k  = new Kisi(txtAdi.Text, txtSoyadi.Text, txtMeslegi.Text, int.Parse(txtDYili.Text));
         PaketYazici py = new PaketYazici();
         py.Write((ushort)Komutlar.Nesne);
         py.YazNesne(k);
         byte[] data = py.ByteGetir();
         trm.Gonder(data, data.Length);
     }
     else
     {
         MessageBox.Show("Lütfen tüm nesne kısımlarını doldurunuz.");
     }
 }