I’m assuming this is from inside Visual Studio… You should be able to right click on GetAllCommand, and select… If I remember correctly, something like “Resolve namespace” or something of that sort… And then select “RouterOS.API.GetAllCommand”.
Or alternatively, you can manually add
use RouterOS.API.GetAllCommand;
Above your class declaration (you know, alongside the rest of the “use” statements).
Once you get the console working successfully, migrating to a WindowsForms application is as simple as putting that same code inside the appropriate event, and replacing “System.Console.WriteLine” with whatever form control’s content you want modified.
The problem is that in SSH using the library for C #, I just get an answer and the session ends, if you want again, start another session and thus generates much logging and processing greatly increases the RouterBoard.
Technically, with both SSH and the API, and with both Console and Windows Forms, it’s up to you to command when you log in and log out. While you are not logged out, you can issue new commands and get their output. As long as the variable holding the TCP connection (in the case above, “conn”) is alive, the connection is alive, and you don’t need to log in again.
can the real-time response but only via Console Application, and would result in a TextBox, via Windows Forms.
You can always append data to a text box, rather than replacing it. This would be one way to see the data over time.
Better yet, you could use a more appropriate control, in which you can add multiple data points. In the case of CPU or queue measurements, a graphing utility, such as the built in Chart control (for .NET 4.5 and later) or this library would be most appropriate… But admittedly, more difficult to learn.