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.StringThe 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.
ipVersion
Type: Microsoft.TeamFoundation.Common.NET_FW_IP_VERSION_IP version of the traffic. If localAddress is non-NULL, this must not be NET_FW_IP_VERSION_ANY.
portNumber
Type: System.Int32Local IP port number of the traffic.
localAddress
Type: System.StringEither 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.
ipProtocol
Type: Microsoft.TeamFoundation.Common.NET_FW_IP_PROTOCOL_IP protocol of the traffic, either NET_FW_IP_PROTOCOL_TCP or NET_FW_IP_PROTOCOL_UDP.
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
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.