Get Started (IBM)
//This sample code is intended to illustrate a concept, and it shows only the code that is relevant to that concept.
//It may not meet the security requirements for a specific environment, and it should not be used exactly as shown.
//We recommend that you add security and error-handling code to make your projects more secure and robust.
//Attachmate provides this sample code "AS IS" with no warranties.
static void Main(string args)
//GettingStartedConsole gets the Terminal control of a running session.
//Before you run this sample, make sure the session used in GetControlsByFilePath()
//is running in a Reflection workspace.
Attachmate.Reflection.Framework.Application reflectionApplication = MyReflection.CreateApplication("myWorkspace", true);
if (reflectionApplication != null)
object terminals = reflectionApplication.GetControlsByFilePath(@"C:\Users\[user name]\Documents\Attachmate\Reflection\[session filename]");
if (terminals != null && terminals.Length > 0)
IIbmTerminal terminal = (IIbmTerminal)terminals;
IIbmScreen screen = terminal.Screen;
string text = screen.GetText(18, 2, 48);
Console.WriteLine("No such control exists. Check to make sure that the session from the file is running.");
Console.WriteLine("Failed to get Application object.");