|
-
Mar 26th, 2008, 01:12 AM
#1
Thread Starter
Member
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.
-
Mar 26th, 2008, 01:24 AM
#2
Fanatic Member
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

-
Mar 26th, 2008, 02:09 AM
#3
Fanatic Member
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

-
Mar 26th, 2008, 10:36 AM
#4
Thread Starter
Member
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.
-
Mar 26th, 2008, 10:52 PM
#5
Fanatic Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|