Exemplo n.º 1
0
        private void btnInitialize_Click(object sender, EventArgs e)
        {
            if (checkSGXDMA.Checked == true)
            {
                m_pSKCenter.SKCenterLib_SetAuthority(0);
            }
            else
            {
                m_pSKCenter.SKCenterLib_SetAuthority(1);
            }

            //[-for API exam switch-0513-add-]
            if (Chk_Env.Checked == true)
            {
                m_pSKCenter.SKCenterLib_ResetServer("morder1.capital.com.tw");
            }

            m_nCode = m_pSKCenter.SKCenterLib_Login(txtAccount.Text.Trim().ToUpper(), txtPassWord.Text.Trim());

            if (m_nCode == 0)
            {
                WriteMessage("登入成功");
                skOrder1.LoginID   = txtAccount.Text.Trim().ToUpper();
                skReply1.LoginID   = txtAccount.Text.Trim().ToUpper();
                skQuote1.LoginID   = txtAccount.Text.Trim().ToUpper();
                skosQuote1.LoginID = txtAccount.Text.Trim().ToUpper();
            }
            else
            {
                WriteMessage(m_nCode);
            }
        }
Exemplo n.º 2
0
        private void btnInitialize_Click(object sender, EventArgs e)
        {
            if (ckBox_OrderM.Checked == true)
            {
                m_nCode = m_pSKCenter.SKCenterLib_LoginOrderM(txtAccount.Text.Trim().ToUpper(), txtPassWord.Text.Trim());
            }
            else
            {
                if (checkSGXDMA.Checked == true)
                {
                    m_pSKCenter.SKCenterLib_SetAuthority(0);
                }
                else
                {
                    m_pSKCenter.SKCenterLib_SetAuthority(1);
                }

                //[-for API exam switch-0513-add-]
                if (Chk_Env.Checked == true)
                {
                    m_pSKCenter.SKCenterLib_ResetServer("morder1.capital.com.tw");
                }

                m_nCode = m_pSKCenter.SKCenterLib_Login(txtAccount.Text.Trim().ToUpper(), txtPassWord.Text.Trim());
            }
            if (m_nCode == 0)
            {
                WriteMessage(DateTime.Now.TimeOfDay.ToString() + "登入成功");
                skOrder1.LoginID           = txtAccount.Text.Trim().ToUpper();
                skOrder1.ContinuousTrading = ckBox_OrderM.Checked;//[for OrderM]

                skReply1.LoginID = txtAccount.Text.Trim().ToUpper();
                skReply1.OrderM  = ckBox_OrderM.Checked;//[for OrderM]

                skQuote1.LoginID   = txtAccount.Text.Trim().ToUpper();
                skosQuote1.LoginID = txtAccount.Text.Trim().ToUpper();
            }
            else
            {
                WriteMessage(m_nCode);
            }
        }