panchopp Posted April 10, 2006 Posted April 10, 2006 Hi guys, I'm starting with VB.NET 2003 (as requested per job's demand). I have a requirement to look for a port and see if it is in use. Do you know of any commands to do that? Should I use some socket native function or what? Thank you Very MUCH! Quote
Gill Bates Posted July 4, 2006 Posted July 4, 2006 Although not the most elegant solution, you can just catch the SoapException that gets thrown when the port is already in use:TcpListener server; try { server = new TcpListener(IPAddress.Any, 80); server.Start(); } catch (SocketException ex) { Console.WriteLine(ex); } Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.