Results 1 to 6 of 6

Thread: how to block a TCP/IP port using visual Basic 6?

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2005
    Posts
    2

    how to block a TCP/IP port using visual Basic 6?

    Hello Every one. This is my first thread in this amazing forum.

    I hope I don't look like an alien to you people


    I need your help.


    Can any one tell me how to block a TCP/IP port using visual Basic 6 please?


    I hope to continue being part of this lovely forum. Thanks.
    Last edited by mbader71; Apr 27th, 2005 at 06:50 AM.

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: how to block a TCP/IP port using visual Basic 6?

    Welcome to the forums.

    Have you read the posts in this thread? I think some of what has been posted there will help.
    Last edited by Hack; Apr 27th, 2005 at 08:36 AM.

  3. #3
    PowerPoster Halsafar's Avatar
    Join Date
    Jun 2004
    Location
    Saskatoon, SK
    Posts
    2,339

    Re: how to block a TCP/IP port using visual Basic 6?

    Well that link posted above seemingly didn't touch on your topic at all....

    If you know Winsock well enough in VB... If you can make a simple server-client chat program you are already a step ahead.
    If you can make a port sniffer then you are even farther ahead.

    What you want to do is attemp a connection on a port, if it is in use then attemp to close it. If you can get it closed, then use your program to open a new connection with that port and leave it open, do not recieve any data, do not send any data. Essentially you will have it blocked, but I'm sure there is a more technical way.
    "From what was there, and was meant to be, but not of that was faded away." - - Steve Damm

    "The polar opposite of nothingness is existance. When existance calls apon nothingness it shall return to nothingness." - - Steve Damm

    "When you do things right, people won't be sure if you did anything at all." - - God from Futurama

  4. #4
    Lively Member
    Join Date
    Apr 2005
    Posts
    127

    Re: how to block a TCP/IP port using visual Basic 6?

    Hey,

    I've been trying to do this for a while. Maybe one of you can help me out??
    Really simple code really. I looked at all the code that I could have used but none of them really work with this port close ing...

    Any ideas?
    VB Code:
    1. Private Sub Command1_Click()
    2.  
    3.      Winsock1.LocalPort = 3907
    4.      Winsock1.Close
    5.      Winsock1.Listen
    6.    
    7. End Sub

  5. #5

    Thread Starter
    New Member
    Join Date
    Apr 2005
    Posts
    2

    Thumbs down Re: how to block a TCP/IP port using visual Basic 6?

    Quote Originally Posted by Brin
    Hey,

    I've been trying to do this for a while. Maybe one of you can help me out??
    Really simple code really. I looked at all the code that I could have used but none of them really work with this port close ing...

    Any ideas?
    VB Code:
    1. Private Sub Command1_Click()
    2.  
    3.      Winsock1.LocalPort = 3907
    4.      Winsock1.Close
    5.      Winsock1.Listen
    6.    
    7. End Sub

    I am sorry. I've tried this but this does'nt work

  6. #6
    Lively Member
    Join Date
    Apr 2005
    Posts
    127

    Re: how to block a TCP/IP port using visual Basic 6?

    Well yea, i posted that for debugging lol

    A way to block ports, Im prreety sure You can't close ports which are being used using Winsock tho...

    VB Code:
    1. Private Sub Command1_Click()
    2.  
    3.      Winsock1.LocalPort = 3907
    4.      Winsock1.Listen
    5.    
    6. End Sub

    I didn't test it But if you change the local port to lets say.. 100 And a program tries to use port 100 they will be unseccessfull because it is already being used. The "listen" command with work until the program that you made is closed. You can However make it so that when they try to close the program it only hides itself and is only seen in processes...Search the forums to do that, should be plently posts about it

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width