Port Check Tool In C#

Simple port check tool for windows









Tool Download here...


Link Type Size
7z
  12KB 
exe
 75KB

C# Source download

  1. using System;
  2. using System.Windows.Forms;
  3. using System.Net.Sockets;
  4. namespace PortCheck
  5. {
  6.     public partial class Form1 : Form
  7.     {
  8.         public Form1()
  9.         {
  10.             InitializeComponent();
  11.         }
  12.         private void btnCheck_Click(object sender, EventArgs e)
  13.         {
  14.             TcpClient cli = new TcpClient();
  15.             int port = 0;
  16.             string ip;
  17.             try
  18.             {
  19.                 port = Convert.ToInt32(txtPort.Text.Trim());
  20.                 ip = txtIP.Text.Length > 7 ? txtIP.Text : "0.0.0.0";
  21.                 cli.Connect(ip, port);
  22.                 MessageBox.Show(cli.Connected == true ? "Port Opened" : "Port Closed"this.Text);
  23.             }
  24.             catch (Exception ex) { MessageBox.Show(ex.Messagethis.Text); }
  25.         }
  26.     }
  27. }




Comments

Popular posts from this blog

Brother printer password reset using telnet

How to adjust the brightness in Samsung 19" SyncMaster SA100 LED monitor?

ASP.NET Server Controls Tutorial