using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace UDP_Uygulama
{
public partial class Form1 : Form
{
send a = new send();
receive b = new receive();
int counter = 0;
public Form1()
{
InitializeComponent();
timer1.Interval = 10;
}
private void button1_Click(object sender, EventArgs e)
{
string ip, mesaj;
Int32 port;
ip = textBox1.Text;
port = Convert.ToInt32(textBox2.Text);
mesaj = "1";
timer1.Start();
a.uzakip(ip);
a.uzakport(port);
a.mesaj(mesaj);
a.mesajgonder();
}
private void timer1_Tick(object sender, EventArgs e)
{
counter++;
b.mesajal();
label2.Text = b.mesaj;
seviye_komponent1.seviyepanel(Convert.ToDouble(b.mesaj));
if (counter == 300)
counter = 0;
}
}
}