Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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;
- using System.Threading;
- using System.Net;
- using System.Net.Sockets;
- namespace CLIENT_actual_tcp_srvandclient
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- string temp = "";
- private void button1_Click(object sender, EventArgs e)
- {
- //don't ddos me lmao
- Thread tr = new Thread(loopyloops);
- tr.IsBackground = true;
- tr.Start();
- button1.Visible = false;
- }
- private void loopyloops()
- {
- try
- {
- TcpClient client = new TcpClient();
- client.Connect("92.7.225.234 ", 5000);
- while (true)
- {
- NetworkStream stream = client.GetStream();
- byte[] biit = new byte[200];
- stream.Read(biit, 0, biit.Length);
- string outp = Encoding.ASCII.GetString(biit, 0, biit.Length);
- temp = outp;
- }
- }
- catch(Exception e)
- {
- }
- }
- private void timer1_Tick(object sender, EventArgs e)
- {
- if(temp != "")
- {
- textBox1.Text = temp;
- temp = "";
- }
- else
- {
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement