Exemplo n.º 1
0
        void RegSystemInfo()
        {
            byte[] buffer = new byte[512];
            int    nLen   = 0;
            int    res    = FtdcTdAdapter.CTP_GetSystemInfo(buffer, ref nLen);

            if (res != 0 || nLen == 0)
            {
                Console.WriteLine("CTP_GetSystemInfo() 失败, 错误代码 {0}, nLen = {1}", res, nLen);
                return;
            }

            var field = new ThostFtdcUserSystemInfoField();

            field.BrokerID = txtBrokerID.Text;
            field.UserID   = txtUserID.Text;
            Array.Copy(buffer, 0, field.ClientSystemInfo, 0, nLen);

            field.ClientPublicIP  = "127.0.0.1";
            field.ClientIPPort    = 65535;
            field.ClientLoginTime = "11:28:28";
            field.ClientAppID     = "Q7";
            int result = TraderApi.RegisterUserSystemInfo(field);

            if (result == 0)
            {
                Console.WriteLine("RegisterUserSystemInfo() 成功");
            }
            else
            {
                Console.WriteLine("RegisterUserSystemInfo() 失败, 错误代码 {0}", result);
            }

            /*  RegisterUserSystemInfo 错误代码
             * 0 正确
             * -1 字段长度不对
             * -2 非CTP采集的终端信息
             * -3 当前终端类型非多对多中继
             * -5 字段中存在非法字符或者长度超限
             * -6 采集结果字段错误
             */
        }
Exemplo n.º 2
0
 /// <summary>
 ///注册用户终端信息,用于中继服务器多连接模式
 ///需要在终端认证成功后,用户登录前调用该接口
 /// </summary>
 public int RegisterUserSystemInfo(ThostFtdcUserSystemInfoField pUserSystemInfo)
 {
     return(Interop.TdRegisterUserSystemInfo(Handle, pUserSystemInfo));
 }
Exemplo n.º 3
0
 /// <summary>
 ///上报用户终端信息,用于中继服务器操作员登录模式
 ///操作员登录后,可以多次调用该接口上报客户信息
 /// </summary>
 public int SubmitUserSystemInfo(ThostFtdcUserSystemInfoField pUserSystemInfo)
 {
     return(Interop.TdSubmitUserSystemInfo(Handle, pUserSystemInfo));
 }
Exemplo n.º 4
0
 public static extern int TdSubmitUserSystemInfo(IntPtr pApi, ThostFtdcUserSystemInfoField pUserSystemInfo);