Get Started > Open a Session |
You can open session document files that were created in previous sessions. This sample program uses the CreateControl() to create a session from a saved session document file. (For other ways to get terminal sessions, see Getting Terminal and View Objects.)
Open a session |
Copy Code
|
---|---|
using System; using System.Collections.Generic; using System.Text; using Attachmate.Reflection.Framework; using Attachmate.Reflection.Emulation.IbmHosts; using Attachmate.Reflection.UserInterface; namespace OpenASession { class Program { static void Main(string[] args) { //Start a visible instance of InfoConnect or get the instance running at the given channel name Application app = MyReflection.CreateApplication("myWorkspace", true); //Create a terminal from the session document file string sessionPath = Environment.GetEnvironmentVariable("USERPROFILE") + @"\Documents\Micro Focus\InfoConnect\gettingStarted.rd3x"; IIbmTerminal terminal = (IIbmTerminal)app.CreateControl(sessionPath); //Make the session visible in the workspace IFrame frame = (IFrame)app.GetObject("Frame"); frame.CreateView(terminal); } } } |
Open a session |
Copy Code
|
---|---|
using System; using System.Collections.Generic; using System.Text; using Attachmate.Reflection.Framework; using Attachmate.Reflection.Emulation.OpenSystems; using Attachmate.Reflection.UserInterface; namespace OpenASession { class Program { static void Main(string[] args) { //Start a visible instance of InfoConnect or get the instance running at the given channel name Application app = MyReflection.CreateApplication("myWorkspace", true); //Create a terminal from the session document file string sessionPath = Environment.GetEnvironmentVariable("USERPROFILE") + @"\Documents\Micro Focus\InfoConnect\gettingStarted.rdox"; ITerminal terminal = (ITerminal)app.CreateControl(sessionPath); //Make the session visible in the workspace IFrame frame = (IFrame)app.GetObject("Frame"); frame.CreateView(terminal); } } } |
Open a session |
Copy Code
|
---|---|
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Attachmate.Reflection.Framework; using Attachmate.Reflection.Emulation.ALC; using Attachmate.Reflection.UserInterface; namespace QuickStartOpenALC { class Program { static void Main(string[] args) { //Create an application object Attachmate.Reflection.Framework.Application app = MyReflection.CreateApplication("myWorkspace", true); //Create a terminal for an Ibm session string sessionFileALC = Environment.GetEnvironmentVariable("USERPROFILE") + @"\Documents\Micro Focus\InfoConnect\gettingStarted.ialc"; IAlcTerminal terminalALC = (IAlcTerminal)app.CreateControl(sessionFileALC); //Make the session visible IFrame frame = (IFrame)app.GetObject("Frame"); IView sessionViewALC = frame.CreateView(terminalALC); } } } |
Open a session |
Copy Code
|
---|---|
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Attachmate.Reflection.Framework; using Attachmate.Reflection.UserInterface; using Attachmate.Reflection.Emulation.UTS; namespace QuickStartOpenUTS { class Program { static void Main(string[] args) { //Create an application object Attachmate.Reflection.Framework.Application app = MyReflection.CreateApplication("myWorkspace", true); //Create a terminal by opeing the session string sessionFileUTS = Environment.GetEnvironmentVariable("USERPROFILE") + @"\Documents\Micro Focus\InfoConnect\gettingStarted.iuts"; IUtsTerminal terminalUTS = (IUtsTerminal)app.CreateControl(sessionFileUTS); //Make the session visible IFrame frame = (IFrame)app.GetObject("Frame"); IView sessionViewUTS = frame.CreateView(terminalUTS); } } } |