Host(APIServerType, String, String, String, String, String, String) Constructor
Constructor that connects to the server, fails if cannot connect successfully.
Connection and login is carried out asynchronously.
Namespace: T4.APIAssembly: T4API.47 (in T4API.47.dll) Version: 4.7.0.0 (4.7.68.4)
public Host(
APIServerType penServer,
string psAppName,
string psAppLicense,
string psFirm,
string psUsername,
string psPassword,
string psNewPassword
)
Public Sub New (
penServer As APIServerType,
psAppName As String,
psAppLicense As String,
psFirm As String,
psUsername As String,
psPassword As String,
psNewPassword As String
)
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.
- psNewPassword String
- A new password for the user. If it is not blank and different from psPassword then the users password will be changed.
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.
If you need to change the password on login due to receiving a PasswordExpired
login result then pass the new password in the psNewPassword field and it will be
updated. You still need to specify the previous password in the psPassword field.