Exemple #1
0
        private void Main_Load(object sender, EventArgs e)
        {
            mcbTulingRobot.Checked = CSHelper.ReadINI("setup", "robot_switch", path) == "1";
            txtApiKey.Text         = CSHelper.ReadINI("setup", "tuling_key", path);
            txtBotName.Text        = CSHelper.ReadINI("setup", "bot_name", path);
            lbMeInfo.Text          = wxrb._me.NickName + "\n\r" + wxrb._me.UserName;

            //System.Net.WebRequest webreq = System.Net.WebRequest.Create( wxrb._me.HeadImgUrl);
            //System.Net.WebResponse webres = webreq.GetResponse();
            //using(System.IO.Stream stream = webres.GetResponseStream())
            //{
            //    pbMeImg.Image = Image.FromStream(stream);
            //}
            //获取联系人
            wxrb.get_contact();
            for (int i = 0; i < wxrb.contact_list.Count; i++)
            {
                MetroTile tile = new MetroTile();
                tile.Width  = 280;
                tile.Height = 60;
                tile.Name   = wxrb.contact_list[i].UserName;
                var remarkName = wxrb.contact_list[i].RemarkName;
                var nickName   = wxrb.contact_list[i].NickName;

                tile.Text      = remarkName == ""?nickName:remarkName;
                tile.Location  = new Point(0, (tile.Height + 5) * i);
                tile.TileCount = i + 1;
                tile.Click    += TileContactList_Click;
                metroPanel2.Controls.Add(tile);
            }
            backgroundWorker1.RunWorkerAsync();
        }
Exemple #2
0
        public bot()
        {
            var path = System.Windows.Forms.Application.StartupPath + "\\xf.ini";

            robot_switch = CSHelper.ReadINI("setup", "robot_switch", path) == "1";

            tuling_key = CSHelper.ReadINI("setup", "tuling_key", path);

            bot_name = CSHelper.ReadINI("setup", "bot_name", path);
        }
Exemple #3
0
        private void button3_Click(object sender, EventArgs e)
        {
            var Database = CSHelper.ReadINI("Connection", "Database");

            if (!string.IsNullOrEmpty(Database))
            {
                Thread worker = new Thread(delegate()
                {
                    Stopwatch sw = new Stopwatch();
                    try
                    {
                        sw.Start();
                        ShowLoading(true);
                        ApendLog(string.Format("正在对数据库[{0}]进行收缩", Database));
                        ApendLog("-----------------------收缩前大小----------------------------------");
                        countDatabaseSize(Database);
                        CSHelper.exec_sql(string.Format("DBCC SHRINKDATABASE ({0})  ", Database));
                    }
                    catch (Exception ex)
                    {
                        ApendLog(ex.Message);
                    }
                    finally
                    {
                        sw.Stop();
                        TimeSpan ts = sw.Elapsed;
                        ApendLog("数据库收缩完成,耗时:" + string.Format("{0}时{1}分{2}秒{3}毫秒", ts.Hours, ts.Minutes, ts.Seconds, ts.Milliseconds));
                        ApendLog("-----------------------收缩后大小----------------------------------");
                        countDatabaseSize(Database);
                        ShowLoading(false);
                    }
                });
                worker.IsBackground = true;
                worker.Start();
            }
        }
Exemple #4
0
 private void Form1_Load(object sender, EventArgs e)
 {
     lastWord          = CSHelper.ReadINI("Connection", "LastWord");
     txtTableName.Text = lastWord;
 }