Поделиться через


INetFwMgr.IsPortAllowed Method

Checks whether the application can listen to inbound traffic on the specified port.

Namespace:  Microsoft.TeamFoundation.Common
Assembly:  Microsoft.TeamFoundation.Common (in Microsoft.TeamFoundation.Common.dll)

Syntax

'Declaration
Sub IsPortAllowed ( _
    imageFileName As String, _
    ipVersion As NET_FW_IP_VERSION_, _
    portNumber As Integer, _
    localAddress As String, _
    ipProtocol As NET_FW_IP_PROTOCOL_, _
    <OutAttribute> ByRef allowed As Object, _
    <OutAttribute> ByRef restricted As Object _
)
void IsPortAllowed(
    string imageFileName,
    NET_FW_IP_VERSION_ ipVersion,
    int portNumber,
    string localAddress,
    NET_FW_IP_PROTOCOL_ ipProtocol,
    out Object allowed,
    out Object restricted
)
void IsPortAllowed(
    [InAttribute] String^ imageFileName, 
    [InAttribute] NET_FW_IP_VERSION_ ipVersion, 
    [InAttribute] int portNumber, 
    [InAttribute] String^ localAddress, 
    [InAttribute] NET_FW_IP_PROTOCOL_ ipProtocol, 
    [OutAttribute] Object^% allowed, 
    [OutAttribute] Object^% restricted
)
abstract IsPortAllowed : 
        imageFileName:string * 
        ipVersion:NET_FW_IP_VERSION_ * 
        portNumber:int * 
        localAddress:string * 
        ipProtocol:NET_FW_IP_PROTOCOL_ * 
        allowed:Object byref * 
        restricted:Object byref -> unit 
function IsPortAllowed(
    imageFileName : String, 
    ipVersion : NET_FW_IP_VERSION_, 
    portNumber : int, 
    localAddress : String, 
    ipProtocol : NET_FW_IP_PROTOCOL_, 
    allowed : Object, 
    restricted : Object
)

Parameters

  • imageFileName
    Type: System.String
    The image file name of the process listening on the network. It must be a fully-qualified path, but may contain environment variables. If imageFileName is NULL, the function determines whether the port is allowed for all applications.
  • portNumber
    Type: System.Int32
    Local IP port number of the traffic.
  • localAddress
    Type: System.String
    Either a dotted-decimal IPv4 address or an IPv6 hex address specifying the local address of the traffic. Typically, this is the address passed to bind. If localAddress is NULL, the function determines whether the port is allowed for all interfaces.
  • allowed
    Type: System.Object%
    Indicates by a value of VARIANT_TRUE or VARIANT_FALSE whether the port is allowed for at least some local interfaces and remote addresses.
  • restricted
    Type: System.Object%
    Indicates by a value of VARIANT_TRUE or VARIANT_FALSE whether some local interfaces or remote addresses are blocked for this port. For example, if the port is restricted to the local subnet only.

.NET Framework Security

See Also

Reference

INetFwMgr Interface

Microsoft.TeamFoundation.Common Namespace