|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Who is using a given port?I am playing with Listeners. When one define a new TcpListener and starts listening it may happen that there is some other program using that channel. For instance, on my pc DB2 is using port 50000. Const Port As Integer = 50000 Dim LocalIP As System.Net.IPAddress = IPAddress.Parse("127.0.0.1") Dim TcpListener As New TcpListener(LocalIP, Port) TcpListener.Start() 'would rise exception Does anybody have any hint on how can I get the information (at least the name) of a process that is already using a port for its own purposes? I would like to be able to inform the User that a port is being used and, especially, by who. Thanks, -Tom "netstat -anb" displays this information, but I'm not sure how one would do it
programmatically. <tommaso.gasta***@uniroma1.it> wrote in message Show quoteHide quote news:1152101181.019592.305380@a14g2000cwb.googlegroups.com... > Hi friend, > > I am playing with Listeners. When one define a new TcpListener and > starts listening it may happen that there is some other program using > that channel. > For instance, on my pc DB2 is using port 50000. > > Const Port As Integer = 50000 > Dim LocalIP As System.Net.IPAddress = IPAddress.Parse("127.0.0.1") > Dim TcpListener As New TcpListener(LocalIP, Port) > TcpListener.Start() 'would rise exception > > Does anybody have any hint on how can I get the information (at least > the name) of a process that is already using a port for its own > purposes? I would like to be able to inform the User that a port is > being used and, especially, by who. > > Thanks, > > -Tom > Good to know that, Mike.
It would be nice to be able to do it within vb.net. Mike Lowery ha scritto: Show quoteHide quote > "netstat -anb" displays this information, but I'm not sure how one would do it > programmatically. > > <tommaso.gasta***@uniroma1.it> wrote in message > news:1152101181.019592.305380@a14g2000cwb.googlegroups.com... > > Hi friend, > > > > I am playing with Listeners. When one define a new TcpListener and > > starts listening it may happen that there is some other program using > > that channel. > > For instance, on my pc DB2 is using port 50000. > > > > Const Port As Integer = 50000 > > Dim LocalIP As System.Net.IPAddress = IPAddress.Parse("127.0.0.1") > > Dim TcpListener As New TcpListener(LocalIP, Port) > > TcpListener.Start() 'would rise exception > > > > Does anybody have any hint on how can I get the information (at least > > the name) of a process that is already using a port for its own > > purposes? I would like to be able to inform the User that a port is > > being used and, especially, by who. > > > > Thanks, > > > > -Tom > > Probably not part of the Framework, but obviously part of the Win32 API.
<tommaso.gasta***@uniroma1.it> wrote in message Show quoteHide quote news:1152187339.880080.98440@m73g2000cwd.googlegroups.com... > Good to know that, Mike. > > It would be nice to be able to do it within vb.net. > > Mike Lowery ha scritto: > >> "netstat -anb" displays this information, but I'm not sure how one would do >> it >> programmatically. >> >> <tommaso.gasta***@uniroma1.it> wrote in message >> news:1152101181.019592.305380@a14g2000cwb.googlegroups.com... >> > Hi friend, >> > >> > I am playing with Listeners. When one define a new TcpListener and >> > starts listening it may happen that there is some other program using >> > that channel. >> > For instance, on my pc DB2 is using port 50000. >> > >> > Const Port As Integer = 50000 >> > Dim LocalIP As System.Net.IPAddress = IPAddress.Parse("127.0.0.1") >> > Dim TcpListener As New TcpListener(LocalIP, Port) >> > TcpListener.Start() 'would rise exception >> > >> > Does anybody have any hint on how can I get the information (at least >> > the name) of a process that is already using a port for its own >> > purposes? I would like to be able to inform the User that a port is >> > being used and, especially, by who. >> > >> > Thanks, >> > >> > -Tom >> > >
Multithread Revisted
Removing the " Web Form Designer Generated Code " region after converting from ASP.NET 1.1 to ASP.NE Need help on windows service and timer Getting form to run its load event without showing form Confused About Dispose and Finalize in VS.Net Convert Color image to Gray Shade Image Which would be better MS ACESS or SQL Server for VB Desktop application Active Directory and VB.Net how to convert htm file to word or excel file with images as in htm How to use DataGridComboColumnStyle |
|||||||||||||||||||||||