Esempio n. 1
0
        private void CTPOnRspAuth(ref CThostFtdcRspAuthenticateField pRspAuthenticateField, ref CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast)
        {
            if (pRspInfo.ErrorID == 0)
            {
                switch (pRspAuthenticateField.AppType)
                {
                // 多对多
                case TThostFtdcAppTypeType.THOST_FTDC_APP_TYPE_InvestorRelay:
                    _t.RegisterUserSystemInfo(this.Broker, this.Investor, 1, "", this.IP, this.Port, DateTime.Now.ToString("HH:mm:ss"), this.AppID);
                    break;

                case TThostFtdcAppTypeType.THOST_FTDC_APP_TYPE_OperatorRelay:
                    _t.SubmitUserSystemInfo(this.Broker, this.Investor, 1, "", this.IP, this.Port, DateTime.Now.ToString("HH:mm:ss"), this.AppID);
                    break;

                default:
                    break;
                }
                _t.ReqUserLogin(BrokerID: this.Broker, UserID: this.Investor, Password: this.Password, UserProductInfo: this.ProductInfo);
            }
            else
            {
                _OnRspUserLogin?.Invoke(this, new ErrorEventArgs {
                    ErrorID = pRspInfo.ErrorID, ErrorMsg = $"认证错误:{pRspInfo.ErrorMsg}"
                });
            }
        }