SocketPermission Class controls rights to make or accept connections on a transport address. : SocketPermission « Network Remote « VB.Net






SocketPermission Class controls rights to make or accept connections on a transport address.

 

Imports System.IO
Imports System.Net
Imports System.Text
Imports System.Security.Permissions

Public Class MainClass
    Shared Sub Main()
        Dim mySocketPermission1 As New SocketPermission(PermissionState.None)

        mySocketPermission1.AddPermission(NetworkAccess.Accept, TransportType.Tcp, "www.domain.com", 11000)

        Dim mySocketPermission2 As New SocketPermission(NetworkAccess.Connect, TransportType.Tcp, "www.southridgevideo.com", 11002)

        ' Creates a SocketPermission from the union of two SocketPermissions.
        Dim mySocketPermissionUnion As SocketPermission = CType(mySocketPermission1.Union(mySocketPermission2), SocketPermission)
    End Sub 'MySocketPermission
End Class

   
  








Related examples in the same category

1.Creates a SocketPermission from the union of two SocketPermissions