Getting System.Net.SocketPermission to actually work!!!

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MK4L
    New Member
    • Mar 2010
    • 1

    Getting System.Net.SocketPermission to actually work!!!

    Hi,

    The few lines below is basically what I'm trying to do:

    Code:
    Dim sPerm As New SocketPermission(NetworkAccess.Connect, TransportType.Tcp, "207.46.232.182", 80)
    sPerm.PermitOnly()
    Dim ePoint As New IPEndPoint(IPAddress.Parse("207.46.232.182"), 80)
    Dim s As New Socket(ePoint.Address.AddressFamily, SocketType.Stream, ProtocolType.Tcp)
    s.Connect(ePoint)
    MsgBox("Connected:" + s.Connected.ToString)
    s.Close()
    Can anyone tell me why is the System.Net.Sock etPermission implementation so miserable? I could only get .Deny to work, but then it won't work on wild card IP addresses!!

    Help, Please.
Working...