// VB .NET code Private agent As RemoteAgent = Agent.Connect("hostname:port")
// C# code private RemoteAgent agent = Agent.Connect("hostname:port");For additional information, see Testing Applications in Multiple UI Sessions on a Single Machine .
// VB .NET code Dim d As Desktop = agent.Desktop Dim baseState = New BaseState() agent.ExecuteBaseState(basestate) d.SomeAgentFunction()
// C# code Desktop d = agent.Desktop; BaseState basestate = new BaseState(); agent.ExecuteBaseState(basestate); d.SomeAgentFunction();