Results 1 to 5 of 5

Thread: Disconnecting an IP Address

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2007
    Posts
    38

    Disconnecting an IP Address

    I am trying to make sort of a custom firewall program which will block specified ips.

    I currently have a way to obtain the list of the ips that are connected to my computer, but i can't seem to find a way to actually disconnect that ip.

  2. #2
    Fanatic Member vijy's Avatar
    Join Date
    May 2007
    Location
    India
    Posts
    548

    Re: Disconnecting an IP Address

    A lot of samples..Here
    Code:
    Dim myHost as string = System.Net.Dns.GetHostName()
    
    System.Net.IPHostEntry myIPs = System.Net.Dns.GetHostByName(myHost)
    
    
    
    for each myIP as System.Net.IPAddress in myIPs.AddressList
    
    
    
       MessageBox.Show(myIP.ToString());
    
    Next
    Visual Studio.net 2010
    If this post is useful, rate it


  3. #3
    Fanatic Member vijy's Avatar
    Join Date
    May 2007
    Location
    India
    Posts
    548

    Re: Disconnecting an IP Address

    Here in this mod i connected a server and disconnect it..

    Code:
    Imports System.Net.Sockets 
    
    Module Connection 
    
        Dim tcpC As New TcpClient 
      
         Public Sub Connect() 
    
                 'Connect from this to the server at Port 6970 
                  Try 
                       tcpC.Connect("***.***.**.**", 6970) 
                  Catch e As Exception 
                       Console.WriteLine(e.ToString()) 
                  End Try 
        End Sub 
    
        Public Sub Disconnect() 
                tcpC.Close() 
        End Sub 
    
    End Module
    Visual Studio.net 2010
    If this post is useful, rate it


  4. #4

    Thread Starter
    Member
    Join Date
    Jun 2007
    Posts
    38

    Re: Disconnecting an IP Address

    Thanks for the reply but that's not really what I meant.

    I want to disconnect that IP from all internet activity on my computer, I found a way to do it in VB6 but it seems that it doesn't work in 2005.

  5. #5
    Fanatic Member vijy's Avatar
    Join Date
    May 2007
    Location
    India
    Posts
    548

    Re: Disconnecting an IP Address

    why not.. what way?? post here
    Visual Studio.net 2010
    If this post is useful, rate 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