Reflection 2014 .NET API Guide
Create Session from Existing Session File
using System; 
using System.Collections.Generic; 
using System.Text; 
using Attachmate.Reflection.Framework; 
using Attachmate.Reflection.Emulation.IbmHosts; 

namespace CreateSessionFromExistingSessionFile 
{ 

  class Program 
  { 

    static void Main(string[] args) 
    { 


      Attachmate.Reflection.Framework.Application reflectionApplication = MyReflection.CreateApplication("myWorkspace", true); 

      if (reflectionApplication != null) 
      { 

        IIbmTerminal terminal = (IIbmTerminal)reflectionApplication.CreateControl(@"C:\Users\[user name]\Documents\Attachmate\Reflection\[session filename]"); 

        if (terminal != null) 
        { 

          terminal.Connect(); 

          //You can also use AfterConnect event to wait for the connection. 
          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("Can not create the control. Please check the session file path."); 
      } 
      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 CreateSessionFromExistingSessionFile 
{ 

  class Program 
  { 

      Attachmate.Reflection.Framework.Application reflectionApplication = MyReflection.CreateApplication("myWorkspace", true); 

      if (reflectionApplication != null) 
      { 

        ITerminal terminal = (ITerminal)reflectionApplication.CreateControl(@"C:\Users\[user name]\Documents\Attachmate\Reflection\[session filename]"); 


        if (terminal != null) 
        { 
          terminal.Connect(); 
          //You can also use AfterConnect event to wait for the connection. 
          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("Can not create the control. Please check the session file path."); 

      } 
      else 

        Console.WriteLine("Failed to get Application object."); 

  } 

}