[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 775
  • Last Modified:

TCP/UDP connections

Hi Experts,

Exist some way to do a program in delphi to display all TCP and UDP connections in my machine, and can close a connection?

I am using delphi 7

thx
Alexandre
Brazil
0
alpires
Asked:
alpires
  • 4
  • 3
1 Solution
 
JohnjcesCommented:
Here is a link to Delphi code to display all of your connections like netstat. As afar as killing them, that is mor eproblematic.

Maybe this will get you going anyway.

http://smeschini.altervista.org/download/netstat32.php or

http://www.torry.net/vcl/internet/sockets/activeports.zip

John

0
 
alpiresAuthor Commented:
Johnjces I downloaded the program http://smeschini.altervista.org/download/netstat32.php but the source is very complicated for me, I do not understand anything, would you help me?
you could write an example of how to get the tcp connections but with tform and Tlistview created in design time?

Thx
0
 
JohnjcesCommented:
Well, that code is an entrie application. It is a shame that he did not include a dfm file. But, you caqn see you need a listbox and some other stuff.

If I have time tomorrow I will see what I can do for you!

John
0
Microsoft Certification Exam 74-409

VeeamĀ® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
alpiresAuthor Commented:
Please do it for me, if you want I can open another question to give you another 500 points
0
 
JohnjcesCommented:
No worries. But it will be tomorrow I will see what I can do! No need to open a new thread.

Might have some code somewhere that will block ports... not sure though.

John
0
 
JohnjcesCommented:
Alexandre,

What you need to do in Delphi to make this work is very simple!

Start Delphi and go to File > New  then select > Console Application

You will have a formless project.

Copy the entire code EXCEPT for the top portion which is:

program Netstat32; // Advanced Netstat Delphi Source Code (GUI version) - (C) 2003-2005 Salvatore Meschini

(*

If you like this program or you are looking for a custom version please write me at salvatoremeschini@tiscali.it ! Thank you!
Se vuoi dare un contributo allo sviluppo di questo programma scrivi a salvatoremeschini@tiscali.it ! Grazie!

Salvatore Meschini
http://salvatoremeschini.cjb.net

*)

Again, do not copy the above, just everything below it.

I do not have TMSSoftware's WindXPResource stuff, so delete form the code the following lines, unless you happen to have that item.

{$R WINDRES.RES}
{$R WINXP.RES} // Thanks to TMSSOFTWARE - http://www.tmssoftware.com

Again, remove/delete the above 2 lines.

Save it as a project and name it NetStat32.dpr.

Compile it and check for any errors. Run it. You will have a GUI application with some pretty good code to work with.

It ran just fine for me!

Some other stuff which is fairly complex but may help you, is on my FTP site.

In your browser enter:

ftp://jcitssystems.com/pub/DelphiComps and download from there

ipfwhook.zip    and
ipflite.zip

These are components AND source for a complete firewall for Windows. You can drop port packets and other stuff.

I have not used them muhc and do not know where I got them. You are on your own in trying to figure them out.

Good Luck!

John
0
 
alpiresAuthor Commented:
thanks Johnjces
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now