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.
Printable View
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.
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
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
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.
why not.. what way?? post here