static void Main(string[] args) { EsfTcpClient client = new EsfTcpClient("127.0.0.1", 8000); NetworkStream stream = client.GetNetworkStream(); if (stream.CanWrite) { byte[] buffer = new byte[] { 1 }; stream.Write(buffer, 0, 1); } }
private void button1_Click(object sender, EventArgs e) { EsfTcpClient client = new EsfTcpClient("127.0.0.1", 8000); NetworkStream stream = client.GetNetworkStream(); if (stream.CanWrite) { byte[] buffer = new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }; stream.Write(buffer, 0, 20); } }