private void Form1_Load(object sender, EventArgs e) { m_pSKQuoteLib.OnConnection += new _ISKQuoteLibEvents_OnConnectionEventHandler(SKQuoteLib_OnConnection); m_pSKQuoteLib.OnNotifyQuote += new _ISKQuoteLibEvents_OnNotifyQuoteEventHandler(SKQuoteLib_OnNotifyQuote); int nCode = m_pSKCenterLib.SKCenterLib_Login(strID, strPassword); nCode = m_pSKQuoteLib.SKQuoteLib_EnterMonitor(); }
//---------------------------------------------------------------------- // Component Event //---------------------------------------------------------------------- private void connect() { if (m_bfirst == true) { SKQuoteLib.OnConnection += new _ISKQuoteLibEvents_OnConnectionEventHandler(m_SKQuoteLib_OnConnection); SKQuoteLib.OnNotifyQuote += new _ISKQuoteLibEvents_OnNotifyQuoteEventHandler(m_SKQuoteLib_OnNotifyQuote); SKQuoteLib.OnNotifyHistoryTicks += new _ISKQuoteLibEvents_OnNotifyHistoryTicksEventHandler(m_SKQuoteLib_OnNotifyHistoryTicks); SKQuoteLib.OnNotifyTicks += new _ISKQuoteLibEvents_OnNotifyTicksEventHandler(m_SKQuoteLib_OnNotifyTicks); SKQuoteLib.OnNotifyBest5 += new _ISKQuoteLibEvents_OnNotifyBest5EventHandler(m_SKQuoteLib_OnNotifyBest5); SKQuoteLib.OnNotifyKLineData += new _ISKQuoteLibEvents_OnNotifyKLineDataEventHandler(m_SKQuoteLib_OnNotifyKLineData); SKQuoteLib.OnNotifyServerTime += new _ISKQuoteLibEvents_OnNotifyServerTimeEventHandler(m_SKQuoteLib_OnNotifyServerTime); m_bfirst = false; } m_nCode = SKQuoteLib.SKQuoteLib_EnterMonitor(); SendReturnMessage("Quote", m_nCode, "SKQuoteLib_EnterMonitor"); }
private void Button1_Click(object sender, EventArgs e) { acc = textBox1.Text; pw = textBox2.Text; connect_status = skc.SKCenterLib_Login(acc, pw); if (connect_status == 0) { msg_update("登入成功"); connect_status = skq.SKQuoteLib_EnterMonitor(); if (connect_status == 0) { msg_update("連線成功"); } else { msg_update("連線錯誤代碼: " + Convert.ToString(connect_status)); } } else { msg_update("登入錯誤代碼: " + Convert.ToString(connect_status)); } }
public void Connect() { m_nCode = m_SKQuoteLib.SKQuoteLib_EnterMonitor(); OnActionExecuted("EnterMonitor"); }