Beispiel #1
0
        private void toolStripButton1_Click(object sender, EventArgs e)
        {
            Login login = new Login();
            DialogResult dr = new DialogResult();
            dr = login.ShowDialog();
            if (dr == DialogResult.OK)
            {
                ser = login.server;
                uname = login.username;
                pass = login.pass;
            }
            connetionString = @"Data Source="+ser+
                ",1433;Network Library = DBMSSOCN; Initial Catalog = u453901;User ID ="+
                uname+"; Password ="+pass;
            isConnected = true; lastCheck = DateTime.UtcNow;


        }
Beispiel #2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            //String fdsa = Cookie.GetCookies(Define.Domain);
            //MessageBox.Show(fdsa);

            Data.init();

            Login login = new Login();  //新建一个NewForm窗口(NewForm是自己定义的Form)
            login.ShowDialog();         //新窗口显现

            if (Data.GetLoginResult != Define.Login_Succeed)
            {
                this.Close();
                return;
            }

            this.MaximizeBox = false;
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
            //String  dda = Des.GetMachineInfo(channel.ToString());

            CreateColumnHeader(listView_Order);
            CreateColumnHeader(listView_Completed);

            ColumnHeader BTCc1 = new ColumnHeader();
            BTCc1.Text = "比特币BTC预警";
            BTCc1.Width = 210;
            listViewBTC.Columns.AddRange(new ColumnHeader[] { BTCc1 });//将这两列加入listView1
            listViewBTC.View = View.Details;

            ColumnHeader LTCc1 = new ColumnHeader();
            LTCc1.Text = "莱特币LTC预警";
            LTCc1.Width = 210;
            listViewLTC.Columns.AddRange(new ColumnHeader[] { LTCc1 });//将这两列加入listView1
            listViewLTC.View = View.Details;

            Title = Define.TitleBase;
            this.Text = Title;

            String mac = "";
            NetworkInterface[] netWorks = NetworkInterface.GetAllNetworkInterfaces();
            foreach (NetworkInterface netWork in netWorks)
            {
                mac += netWork.GetPhysicalAddress().ToString();
            }

            timer.Interval = 1000;
            timer.Enabled = true;

            timerWarnPlay.Interval = 60000;
            timerWarnPlay.Enabled = false;

            timerDepth.Interval = 1000;
            timerDepth.Enabled = true;

            timer_AccountRecord.Interval = 5000;
            timer_AccountRecord.Enabled = true;
            timer_order.Interval = 5000;
            timer_order.Enabled = true;

            timer_OrderHistory.Interval = 5000;
            timer_OrderHistory.Enabled = true;

            tabControl1.Width = 745;
            tabControl1.Height = 224;

            lab_alert.Text = "";
            lab_sell_alert.Text = "";

            cur_BTCorLTC(0);

            CSPList.Add(CSP5);
            CSPList.Add(CSP4);
            CSPList.Add(CSP3);
            CSPList.Add(CSP2);
            CSPList.Add(CSP1);

            CSNList.Add(CSN5);
            CSNList.Add(CSN4);
            CSNList.Add(CSN3);
            CSNList.Add(CSN2);
            CSNList.Add(CSN1);

            CBPList.Add(CBP1);
            CBPList.Add(CBP2);
            CBPList.Add(CBP3);
            CBPList.Add(CBP4);
            CBPList.Add(CBP5);

            CBNList.Add(CBN1);
            CBNList.Add(CBN2);
            CBNList.Add(CBN3);
            CBNList.Add(CBN4);
            CBNList.Add(CBN5);

            ThreadEx threadex = new ThreadEx();
            threadex.Start(new ThreadStart(threadex.GetCheckVersion), new EventHandler(GetCheckVersion), this);

            ThreadEx threadex2 = new ThreadEx();
            threadex2.Start(new ThreadStart(threadex2.GetUserConfig), new EventHandler(GetUserConfig), this);
        }