Attachmate.Reflection.Framework Namespace > MyReflection Class > CreateApplication Method : CreateApplication(String,Boolean) Method |
If there is no InfoConnect application instance running at the specified channel and the InfoConnect Workspace "API Settings" .Net API option is enabled, a new instance of InfoConnect Workspace is started.
'Declaration
Public Overloads Shared Function CreateApplication( _ ByVal channelName As String, _ ByVal visible As Boolean _ ) As Application
'Usage
Dim channelName As String Dim visible As Boolean Dim value As Application value = MyReflection.CreateApplication(channelName, visible)
public static Application CreateApplication( string channelName, bool visible )
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Attachmate.Reflection.Framework; using Attachmate.Reflection.Emulation.IbmHosts; using Attachmate.Reflection.UserInterface; using System.Drawing; namespace CreateApplicationAndStartInstance { class MyApplication { 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("myReflection", true); //Create a terminal from the session document file string sessionPath = Environment.GetEnvironmentVariable("USERPROFILE") + @"\Documents\Micro Focus\InfoConnect\demoSession.rd3x"; IIbmTerminal terminal = (IIbmTerminal)app.CreateControl(sessionPath); //Perform actions such as getting text from the terminal screen, or changing terminal settings (such as the SSL/TLS version) //Save the session document file with the new settings. MyReflection.ActiveApplication.Close(ApplicationCloseOption.CloseAlwaysSave); } } }