I've been told there is noway to block network ports in VB, is this a fact?
Thanks!
Printable View
I've been told there is noway to block network ports in VB, is this a fact?
Thanks!
It depends on how you want to block them. If you want to prevent servers to be run, you can block a port by using it yourself. The easiest way to do this is to open the port yourself using a winsock control, and just ignore the connectionrequest event.
If you want to prrevent the user from making connections to a specific port (say you want to block the users from making a connection to port 12345, you'll have to dive into API. I've seen an example somewhere (I believe it was at www.vbip.com, not sure) that listed all the open connections, also giving an handle. You would use that handle to close the connection. I can't give you an example of this, because I've never done this myself.Code:Winsock1.LocalPort = 80 ' say we want to block port 80 to prevent the user from running a webserver
Winsock1.Listen