using System;
using System.Collections.Generic;
using System.Text;
using Attachmate.Reflection.Framework;
using Attachmate.Reflection.Emulation.IbmHosts;
namespace GetStartedConsole
{
class Program
{
static void Main(string[] args)
{
Attachmate.Reflection.Framework.Application reflectionApplication = MyReflection.CreateApplication();
if (reflectionApplication != null)
{
IIbmTerminal terminal = (IIbmTerminal)reflectionApplication.CreateControl(new Guid("{09E5A1B4-0BA6-4546-A27D-FE4762B7ACE1}"));
if (terminal != null)
{
terminal.HostAddress = "[MyHost]";
terminal.Connect();
while (!terminal.IsConnected)
{
System.Threading.Thread.Sleep(500);
}
IIbmScreen screen = terminal.Screen;
screen.WaitForHostSettle(6000, 3000);
string text = screen.GetText(18, 2, 48);
Console.WriteLine(text);
}
else
Console.WriteLine("Failed to create the control.");
}
else
Console.WriteLine("Failed to get Application object.");
}
}
}
using System;
using System.Collections.Generic;
using System.Text;
using Attachmate.Reflection.Framework;
using Attachmate.Reflection.Emulation.OpenSystems;
namespace GetStartedConsole
{
class Program
{
static void Main(string[] args)
{
Attachmate.Reflection.Framework.Application reflectionApplication = MyReflection.CreateApplication();
if (reflectionApplication != null)
{
ITerminal terminal = (ITerminal)reflectionApplication.CreateControl(new Guid("{BE835A80-CAB2-40d2-AFC0-6848E486BF58}"));
if (terminal != null)
{
IConnectionSettingsTelnet conn = (IConnectionSettingsTelnet)terminal.ConnectionSettings;
conn.HostAddress = "[host_address]";
terminal.Connect();
while (!terminal.IsConnected)
{
System.Threading.Thread.Sleep(500);
}
IScreen screen = terminal.Screen;
string text = screen.GetText(18, 2, 48);
Console.WriteLine(text);
}
else
Console.WriteLine("Failed to create the control.");
}
else
Console.WriteLine("Failed to get Application object.");
}
}
}