Host(APIServerType, String, String, String, String, String) Constructor

Constructor that connects to the server, fails if cannot connect successfully. Connection and login is carried out asynchronously.

Definition

Namespace: T4.API
Assembly: T4API.47 (in T4API.47.dll) Version: 4.7.0.0 (4.7.68.4)
C#
public Host(
	APIServerType penServer,
	string psAppName,
	string psAppLicense,
	string psFirm,
	string psUsername,
	string psPassword
)

Parameters

penServer  APIServerType
Whether the API should connect to the live or simulator system. Either APIServerType.Simulator or APIServerType.Live
psAppName  String
The name of the application as stated when requesting an application license code. T4Example is a valid application on the simulator system only.
psAppLicense  String
The license code for the application. 112A04B0-5AAF-42F4-994E-FA7CB959C60B is the license for T4Example on the simulator system. NOTE that license codes will be different between the live and simulator systems for the same application name.
psFirm  String
The name of the firm you are logging in as. This is the same as the Firm that you enter to log into the website or trading frontend.
psUsername  String
The username that you are logging in as. This is the same as the username that you enter to log into the website or trading frontend.
psPassword  String
The password for the user.

Remarks

Intialises the API and starts attempting to connect to the servers. Once connected it attempts to login with the details provided. The result will be raised via the LoginSuccess or LoginFailure events. If login fails and you want to try again then you need to dispose of this object and create another.

See Also