daily pastebin goal
25%
SHARE
TWEET

Untitled

a guest Sep 26th, 2017 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.         private void connect()
  2.            {
  3.             string server = "127.0.0.1";
  4.             int port = 6667;
  5.                 // Int32.Parse(6667);
  6.  
  7.             TcpClient CSS = new TcpClient(server, port);
  8.             CSS.ReceiveBufferSize = 265;
  9.             string data = string.Empty;
  10.  
  11.             byte[] buffer = new byte[CSS.ReceiveBufferSize];
  12.             NetworkStream stream = CSS.GetStream();
  13.  
  14.             if (stream.CanRead)
  15.             {
  16.                 while (stream.DataAvailable)
  17.                 {
  18.                     int bytesRead = stream.Read(buffer, 0, CSS.ReceiveBufferSize);
  19.                     string.Concat(data, Encoding.ASCII.GetString(buffer, 0, bytesRead));
  20.                 }
  21.             }
  22.             textBox1.Text = data;
  23.         }
RAW Paste Data
Top