Example #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}"
                });
            }
        }
Example #2
0
 public override int ReqUserLogin(string pInvestor, string pPassword, string pBroker)
 {
     return((int)_t.ReqUserLogin(BrokerID: pBroker, UserID: pInvestor, Password: pPassword, UserProductInfo: "@HaiFeng"));
 }
Example #3
0
 private static void t_connected()
 {
     Console.WriteLine("t:connected");
     t.ReqUserLogin(BrokerID: "9999", UserID: "008107", Password: "******");
 }