ANHTCClient.frmTCClient.statusUtilities C# (CSharp) Method

statusUtilities() private method

private statusUtilities ( ) : void
return void
        private void statusUtilities()
        {
            string s;
            myclient = new TcpClient(host, port);
            //get a Network stream from the server
            networkStream = myclient.GetStream();
            streamReader = new StreamReader(networkStream);
            streamWriter = new StreamWriter(networkStream);
            streamWriter.WriteLine("status,utilities," + passkey + "");
            label6.Text = "Sending Request";
            streamWriter.Flush();
            s = streamReader.ReadLine();

            streamReader.Close();
            streamWriter.Close();
            networkStream.Close();
            if (s == "success")
            {
                label4.ForeColor = Color.Lime;
                label4.Text = "ONLINE";
                label6.Text = "Request Completed";
            }
            if (s == "fail")
            {
                label4.ForeColor = Color.Red;
                label4.Text = "OFFLINE";
                label6.Text = "Request Completed";
            }
        }