Results 1 to 6 of 6

Thread: Close all Internet connections

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2006
    Posts
    216

    Close all Internet connections

    i was working on a security program... and kinda got stuck in middle when i had to suspend all internet connections when user doesnt want any internet traffic on there computer... i tired searching couldn't find any code...or method that vb can use to disconnect from internet and then reconnect...

  2. #2
    Frenzied Member
    Join Date
    Nov 2005
    Posts
    1,834

    Re: Close all Internet connections

    This has been asked before and it seems there isn't a good solution for that. The easiest way would probably be using IPConfig.

    Disconnect: Shell "cmd.exe /c IPCONFIG /RELEASE", vbHide
    Connect: Shell "cmd /c IPCONFIG /RENEW", vbHide

    Or checking the TCP Table with a timer and disconnecting already established connections.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    May 2006
    Posts
    216

    Re: Close all Internet connections

    Disconnect: Shell "cmd.exe /c IPCONFIG /RELEASE", vbHide
    Connect: Shell "cmd /c IPCONFIG /RENEW", vbHide
    this works.. but not extaclly what i am looking for =/ cuz i dont want to do it using cmd

    Or checking the TCP Table with a timer and disconnecting already established connections.
    how do i do that

  4. #4
    Frenzied Member
    Join Date
    Nov 2005
    Posts
    1,834

    Re: Close all Internet connections

    There was a good example on vbip.com, but that website seems to be down.
    http://www.vbip.com/iphelper/get_tcp_table.asp

    Here's another example, use SetTcpEntry to stop the connections.
    http://vbnet.mvps.org/index.html?cod...ctiontable.htm

    But like I said, you can only disconnect already established connections, so it's worthless for a security application.

  5. #5
    Frenzied Member
    Join Date
    Jul 2007
    Posts
    1,306

    Re: Close all Internet connections

    IIF(Post.Rate > 0 , , )

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    May 2006
    Posts
    216

    Re: Close all Internet connections

    Quote Originally Posted by Chris001
    Here's another example, use SetTcpEntry to stop the connections.
    http://vbnet.mvps.org/index.html?cod...ctiontable.htm
    yea that is kinda what i was looking for... i got the code to work but i dont know how to disconnect as u said use SetTcpEntry.. what is that? how to use that

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