I am trying to write a simple .net program (to beign with) that will tell me if a particular port is up or down on clients servers at a particular ip address. Example is ping an ipaddress/hostname for ports 21, 25, 110, 80 and it will reply up or if it times out after say 30 seconds or a minute down.
I have found some code on the net and edited it to return if a port is opened or closed.
protected void btnSubmit_Click(object sender, EventArgs e)
StartPort = Convert.ToInt32(txtStartPort.Text);
int CurrPort = StartPort;
TcpClient TcpScan = new TcpClient();
txtPing.Text =("Port " + CurrPort + " open");
txtPing.BackColor = Color.Green;
txtPing.Text = ("Port " + CurrPort + " closed");
txtPing.BackColor = Color.Red;
I will have a DB with many records in them, i will group those records by customer and each customer will have a box in a repeater, in that box several lines (depending on how many ports they have) and so the code will go green or red according to those ports. My
View Complete Post