//KLineProcessCount 2 means Minute and Day KLine check is completed private void Form1_Load(object sender, EventArgs e) { Process[] processes = Process.GetProcessesByName("SKQuote"); if (processes.Length > 1) { MessageBox.Show("SKQuote is already open", "Warning", MessageBoxButtons.OK); util.RecordLog(connectionstr, "SKQuote is already open"); Application.Exit(); } else { KLineProcessCount = 0; // Timer 1 : Tick // Timer 2 : Import Daily, Minute KLine timer1.Interval = 10000; timer1.Enabled = true; timer2.Interval = 20000; timer2.Enabled = true; btnInitialize.PerformClick();//登入群益系統 m_pSKCenter.SKCenterLib_SetLogPath(AppDomain.CurrentDomain.BaseDirectory.ToString() + "log\\"); //this.Controls.Add(skQuote1); Button getbtnConnect = skQuote1.Controls.Find("button1", true).FirstOrDefault() as Button; getbtnConnect.PerformClick();//登入報價系統 } }
//KLineProcessCount 2 means Minute and Day KLine check is completed private void Form1_Load(object sender, EventArgs e) { Process[] processes = Process.GetProcessesByName("SKQuote"); if (processes.Length > 1) { MessageBox.Show("SKQuote is already open", "Warning", MessageBoxButtons.OK); util.RecordLog(connectionstr, "SKQuote is already open", util.ALARM); Application.Exit(); } else { //Timer 1 : Tick //Timer 2 : Import Daily, Minute KLine string[] args = Environment.GetCommandLineArgs(); if (args.Length > 1) { if (args[1].Equals("-KLine", StringComparison.InvariantCultureIgnoreCase)) { KLineProcessCount = 0; } timer2.Interval = 60000; timer2.Enabled = true; } else { timer1.Interval = 10000; timer1.Enabled = true; } btnInitialize.PerformClick();//登入群益系統 m_pSKCenter.SKCenterLib_SetLogPath(AppDomain.CurrentDomain.BaseDirectory.ToString() + "log\\"); //this.Controls.Add(skQuote1); Button getbtnConnect = skQuote1.Controls.Find("button1", true).FirstOrDefault() as Button; getbtnConnect.PerformClick();//登入報價系統 } }
public void btn_Center_Log_Click(object sender, EventArgs e) { m_pSKCenter.SKCenterLib_SetLogPath(txt_Center_LogPath.Text.Trim()); }