using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Threading;
using System.Net;
using System.Net.Sockets;
using System.Security.Cryptography;
namespace GUISimpleTCPClient
{
public partial class GUISimpleTCPClient : Form
{
TcpClient client=null;
NetworkStream stream;
StreamReader reader;
StreamWriter writer;
public GUISimpleTCPClient()
{
InitializeComponent();
}
private void Connect_Click(object sender, EventArgs e)
{
try
{
client=new TcpClient(ipAddress.Text,Convert.ToInt32(port.Text));
listBox1.Items.Add("Connected to Server");
stream = client.GetStream();
reader = new StreamReader(stream);
writer = new StreamWriter(stream);
string msg = reader.ReadLine();
listBox1.Items.Add("Recieved form …
Run Code Online (Sandbox Code Playgroud) c# ×1