Click or drag to resize

Getting Started

The Flex.Hal.Ohio Namespace provides classes, methods, properties and events for accessing host information programmatically. Software developers use these classes to write .NET host integration applications to IBM Z (Mainframe), IBM i (AS/400), Unix and Linux host platforms.

The following example connects to a 3270 host and performs a simple screen navigation:

OhioSessions sessMgr = new OhioSessions();
// We need to specify at least the host name and the host port number.
ConnectionSettings cs = new ConnectionSettings()
{
   HostNameIP = "zos.myflexterm.com",
   Port = 623
};
OhioSession session = sessMgr.AddSession(cs);
// Connect to the host
await session.ConnectAsync();
// Wait for the text "TSO" to appear at position 1612 (row 21, column 13)
await session.Screen.WaitForStrAsync("TSO", 1612, 2000, false, CancellationToken.None);
// Wait for no input inhibit condition
await session.Screen.WaitForNoXAsync(2000, CancellationToken.None);
// Send logon command
await session.Screen.SendKeysAsync("logon z08126", session.Screen.Cursor, CancellationToken.None);
await session.Screen.SendAidAsync(OhioKey.ENTER);
// Wait for the text "field" to appear at position 1914 (row 24, column 75)
await session.Screen.WaitForStrAsync("field", 1914, 2000, false, CancellationToken.None);
// Perform other navigations...
// Disconnect from the host
await session.DisconnectAsync();

The Flex.Hal.Term Namespace provides a full terminal emulation screen with keyboard and mouse support.

The following example demonstrates how to embed a terminal control into your WPF application:

XML
<Window x:Class="DemoWpfSimple.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:term="clr-namespace:Flex.Hal.Term;assembly=Flex.Hal.Term"
        Title="Demo Wpf Simple" Height="560" Width="820">
  <Grid >
    <term:HaoTerm x:Name="xHaoTerm"/>
  </Grid>
</Window>

And in the code behind, set the Session property to a session created from a OhioSessions.AddSession.

public MainWindow()
{
   InitializeComponent();
   OhioSessions sessMgr = new OhioSessions();
   // We need to specify at least the host name and the host port number.
   ConnectionSettings cs = new ConnectionSettings()
   {
      HostNameIP = "zos.myflexterm.com",
      Port = 623
   };
   OhioSession session = sessMgr.AddSession(cs);
   xHaoTerm.Session = session;
   // Connect to the host
   session.ConnectAsync();
}