Esempio n. 1
0
 //判断当前是否为投票项目
 public bool IsVoteTask()
 {
     IsAutoVote = ConfigCore.GetConfig("isAutoVote") == "1";
     return(TaskName.Equals(TASK_VOTE_PROJECT) || TaskName.Equals(TASK_VOTE_JIUTIAN) ||
            TaskName.Equals(TASK_VOTE_YUANQIU) ||
            TaskName.Equals(TASK_VOTE_MM) || TaskName.Equals(TASK_VOTE_ML) || TaskName.Equals(TASK_VOTE_JZ) ||
            TaskName.Equals(TASK_VOTE_JT) || TaskName.Equals(TASK_VOTE_DM) || TaskName.Equals(TASK_VOTE_OUTDO));
 }
Esempio n. 2
0
        //网络检测
        public static void NetCheck()
        {
            bool online = Net.IsOnline();

            if (!online)
            {
                RasOperate("connect");
                Thread.Sleep(1000);
                online = Net.IsOnline();
                if (!online)
                {
                    RasOperate("connect");
                    Thread.Sleep(1000);
                    online = Net.IsOnline();
                    if (!online)
                    {
                        string exception = ConfigCore.GetBaseConfig("exception");
                        if (exception == "1")
                        {
                            ConfigCore.NetError("error");
                        }
                        else
                        {
                            ConfigCore.WriteBaseConfig("exception", "1");
                            Process.Start("shutdown.exe", "-r -t 0");
                            Form1.MainClose();
                        }
                    }
                }

                ConfigCore.WriteBaseConfig("exception", "0");
                string arrDrop = ConfigCore.GetConfig("ArrDrop");
                if (!StringUtil.isEmpty(arrDrop))
                {
                    arrDrop = " " + arrDrop;
                }
                if (arrDrop.IndexOf(" " + ConfigCore.Sort + " |") != -1)
                {
                    ConfigCore.WriteConfig("ArrDrop", arrDrop.Replace(" " + ConfigCore.Sort + " |", ""));
                }
            }
        }