COM Interface C# Sample
This sample executes a task and displays the results. It contains a single task called Task, and a single input and output called respectively, Input and Output. The task is defined in a sample task file generated in Task Builder for Screens.
using System;
using System.Xml;
using SCREENCONNECTORLib;
namespace CSharpApp
{
class Test
{
[STAThread]
static void Main(string[] args)
{
ScreenConnector connector = null;
try
{
connector = new ScreenConnector();
connector.open("C:\\Program Files\\Attachmate\\EAI\\recordings\\Test\\connector\\Test.xml");
connector.execute("Task","<ScreenInputs><Input>data</Input></ScreenInputs>");
XmlDocument outputXML = new XmlDocument();
outputXML.LoadXml(connector.getData());
String result = outputXML.GetElementsByTagName("Output").Item(0).InnerText;
System.Console.Out.WriteLine(result);
}
catch (Exception xx)
{
System.Console.Error.WriteLine(xx.ToString());
}
finally
{
try { connector.close(); } catch (Exception xx) {}
}
}
}
}