using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Net.Sockets; using System.Threading; using System.IO; namespace _2313_InClass_Client { public partial class Form1 : Form { TcpClient TC; public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { TC = new TcpClient(); TC.Connect("localhost", 2313); } private void buttonSend_Click(object sender, EventArgs e) { StreamWriter SW = new StreamWriter(TC.GetStream()); SW.WriteLine(textBoxInput.Text); SW.Flush(); } } }