-
August 21st, 2003, 01:05 PM
#1
Blocking ports in VB can it really be done?
I've been told there is noway to block network ports in VB, is this a fact?
Thanks!
-
August 22nd, 2003, 04:51 AM
#2
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.
Code:
Winsock1.LocalPort = 80 ' say we want to block port 80 to prevent the user from running a webserver
Winsock1.Listen
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|