How to access property of Renci.SshNet.ForwardedPortRemote in C# with Visual Studio

147 Views Asked by At

In the immediate window of Visual Studio, with C#, after writing the word port, I am getting this one:

port
{Renci.SshNet.ForwardedPortRemote}
    BoundHost: "123.45.67.89"
    BoundHostAddress: {123.45.67.89}
    BoundPort: 4222
    Host: "123.45.67.89"
    HostAddress: {123.45.67.89}
    IsStarted: true
    Port: 4222

Question - how to display the value of BoundPort on the console? I have tried this:

Console.WriteLine($"Trying port {port}.");

But then of course, I am getting only the class name.

Console.WriteLine($"Trying port {port["BoundPort"]}.");

does not compile.

0

There are 0 best solutions below