GetContents Method (ConsoleWindow)

Class

ConsoleWindow.

Action

Returns the contents of the console.

Syntax

C#
lsContents = consoleWindow.GetContents ([sItemIdentifier])
VB
lsContents = consoleWindow.GetContents ([sItemIdentifier])
Variable Description
lsContents The console contents. LIST OF STRING.
sItemIdentifier The index of the console window or the caption of the window. If this parameter is left blank, Silk4NET returns the contents of the first found console window. STRING.

Notes

  • Each string in the returned list of strings corresponds to one row in the console.

Example 1

The following sample shows how you can use the index to define that you want to get the contents of the second console window:
lsContents = consoleWindow.GetContents(2)

Example 2

The following sample shows how you can use the full identifier of a console window to get the contents of the console window:
lsContents = consoleWindow.GetContents("C:\\Windows\\system32\\cmd.exe[1]")