mercredi 1 avril 2015

Checking For Blocked Ports in VB.NET

I'm currently building a program that is being used to carry out multiple checks on the computer it is running on. This includes permissions for folders & registry keys, which i have working, and checking whether ports are blocked. My issue is that i have only managed to find methods that can be used to check whether ports are open, but not blocked. Currently i use the following:



Try
Dim bla As TcpClient = New TcpClient("localhost", PortNumber)
If bla.Connected = True Then
Return True
Else
Return False
End If
Catch ex As Exception
Return False
End Try


Does anyone have a piece of code i can instead use to check for blocked ports?


Thanks :)`


Aucun commentaire:

Enregistrer un commentaire