NetworkControllerTestPort Method |
Tests for an active port.
Namespace:
Xcalibur.Controllers
Assembly:
Xcalibur.Controllers (in Xcalibur.Controllers.dll) Version: 1.0.5.0 (1.0.0.0)
Syntax public static bool TestPort(
string machine,
int port
)
Public Shared Function TestPort (
machine As String,
port As Integer
) As Boolean
public:
static bool TestPort(
String^ machine,
int port
)
static member TestPort :
machine : string *
port : int -> bool
Parameters
- machine
- Type: SystemString
The machine. - port
- Type: SystemInt32
The port.
Return Value
Type:
BooleanExamples 1
2private static void Main()
3{
4
5 const int port = 135;
6 var status = NetworkController.TestPort("localhost", port);
7 var statusMessage = status ? "open" : "closed";
8 Console.WriteLine($"Port {port} is {statusMessage}.");
9
10
11 Console.Read();
12}
13
14
See Also