private void ReqAuthenticate() { var req = new ThostFtdcReqAuthenticateField(); req.BrokerID = BrokerID; req.UserID = this.textBox1.Text; req.AuthCode = AuthCode; req.UserProductInfo = UserProductInfo; int iResult = TraderApi.ReqAuthenticate(req, ++iRequestID); }
private void Auth() { var field = new ThostFtdcReqAuthenticateField { AuthCode = this._config.AuthCode, BrokerID = this._config.BrokerId, UserID = this._config.Account, UserProductInfo = this._config.UserProductInfo }; var ret = this._trade.ReqAuthenticate(field, this._session.NextRequestID()); if (ret != 0) { throw new Exception(string.Format("请求认证失败,返回{0}", ret)); } }
/// <summary> /// """申请验证""" /// </summary> public void Authenticate() { if (string.IsNullOrEmpty(UserID) && string.IsNullOrEmpty(BrokerID) && string.IsNullOrEmpty(AuthCode) && string.IsNullOrEmpty(UserProductInfo)) { ThostFtdcReqAuthenticateField req = new ThostFtdcReqAuthenticateField(); req.AuthCode = this.BrokerID; req.UserID = this.UserID; req.AuthCode = this.AuthCode; req.UserProductInfo = this.UserProductInfo; this.ReqAuthenticate(req, ++reqID); } }
void TraderApi_OnFrontEvent(object sender, OnFrontEventArgs e) { switch (e.EventType) { case EnumOnFrontType.OnFrontConnected: { if (chkAuthenticate.Checked) { var req = new ThostFtdcReqAuthenticateField(); req.BrokerID = txtBrokerID.Text; req.UserID = txtUserID.Text; req.AppID = txtAppID.Text; req.AuthCode = txtAuthCode.Text; TraderApi.ReqAuthenticate(req, ++iRequestID); } else { ReqUserLogin(); } } break; } }
/// <summary> ///客户端认证请求 /// </summary> public int ReqAuthenticate(ThostFtdcReqAuthenticateField pReqAuthenticateField, int nRequestID) { return(Interop.TdReqAuthenticate(Handle, pReqAuthenticateField, nRequestID)); }
public static extern int TdReqAuthenticate(IntPtr pApi, ThostFtdcReqAuthenticateField pReqAuthenticateField, int nRequestID);