Ejemplo n.º 1
0
        private void foo()
        {
            var    ks           = MyFuncUtil.GetTimestamp();
            var    ks_gxyunxing = MyFuncUtil.GetTimestamp();
            var    ks_cqyunxing = MyFuncUtil.GetTimestamp();
            var    i            = 1;
            string zidong       = "";

            while (true)
            {
                Thread.Sleep(1000);
                var js = MyFuncUtil.GetTimestamp();
                i++;
                //MyFuncUtil.SecondToHour(+i + (js - ks) / 1000+" "
                CalcFinished("程序已运行:" + MyFuncUtil.SecondToHour(js - ks) + zidong);
                this.label1.ForeColor = Color.Red;
            }
        }
Ejemplo n.º 2
0
        private void foo()
        {
            var ks = MyFuncUtil.GetTimestamp();
            var i  = 1;

            while (true)
            {
                Thread.Sleep(1000);
                var js = MyFuncUtil.GetTimestamp();
                i++;
                //MyFuncUtil.SecondToHour(+i + (js - ks) / 1000+" "
                CalcFinished("程序已运行:" + MyFuncUtil.SecondToHour(js - ks));
                this.label2.ForeColor = Color.Red;
                if (1 != 1)
                {
                    //break;
                }
            }
        }
Ejemplo n.º 3
0
        private void duoxianxunhuan(string a_b, int dqinx, int xhcishu)
        {
            string dizhi = null;
            string path  = null;
            string seed  = null;

            MyFuncUtil.myqiehuancd(a_b, out dizhi, out path, out seed);
            //MyLdcmd.mySort(dizhi);
            var cishu   = 0;
            var cgcishu = 0;

            for (int cs = 0; cs < xhcishu; cs++)
            {
                var ks = MyFuncUtil.GetTimestamp();
                Thread.Sleep(2000);
                MyFuncUtil.mylogandxianshi("模拟器" + dqinx + "进入到循环当中");
                Thread.Sleep(1000);
                bool temp = false;
                if (!temp)
                {
                    MyFuncUtil.mylogandxianshi("模拟器" + dqinx + "关闭失败");
                    Thread.Sleep(20000);
                    continue;
                }
                MyFuncUtil.mylogandxianshi("模拟器" + dqinx + "复原");
                MyLdcmd.myRestore(dqinx, seed, dizhi);
                MyFuncUtil.mylogandxianshi("模拟器" + dqinx + "改名");
                MyLdcmd.myRename(dqinx, "雷" + dqinx + "-" + cgcishu, dizhi);
                temp = MyFuncUtil.Launch(dqinx, dizhi);
                if (!temp)
                {
                    MyFuncUtil.mylogandxianshi("模拟器" + dqinx + "打开失败");
                    Thread.Sleep(20000);
                    continue;
                }
                int i = MyFuncUtil.QiDongWanChengInx(a_b, dqinx, apkName);
                if (i == -1)
                {
                    MyFuncUtil.mylogandxianshi("模拟器" + dqinx + "打开app" + apkName + "失败");
                    Thread.Sleep(20000);
                    continue;
                }
                MyLdcmd.mySort(a_b);
                //Thread.Sleep(2000 * 60 * 200);
                //lock (obj)
                {
                    myDm        dm = new myDm();
                    MingRi_Sort mr = new MingRi_Sort(dm, dqinx, dizhi);
                    //登录 要下载文件 暂定十分钟 发现start按钮则立刻跳出
                    tmpBool = mr.denglu(10);
                    if (!tmpBool)
                    {
                        tmpBoolString.Append("登录环节出错");
                        return;
                    }
                    tmpBool = mr.zhuce(3);
                    if (!tmpBool)
                    {
                        tmpBoolString.Append("注册环节出错");
                        return;
                    }
                    string bmpname = dqinx + "_" + dm.GetTime();
                    mr.zhuxian();
                    Thread.Sleep(10000);
                    int rg = mr.ganyuan_jietu();
                    if (rg != -1)
                    {
                        Thread.Sleep(10000);
                        MyLdcmd.myScreencap(dqinx, path + bmpname + ".png", dizhi);
                        Thread.Sleep(20000);
                        if (dm.IsFileExist(path + bmpname + ".png") == 1)
                        {
                            string abc = mr.generalBasicDemo(dqinx, path + bmpname + ".png");
                            WriteLog.WriteLogFile(dqinx + "", abc + " " + abc.Length);
                            MyFuncUtil.MyRestore(dqinx, abc, a_b);
                            if (abc.Length > 0)
                            {
                                cgcishu++;
                            }
                            else
                            {
                                dm.DeleteFile(path + bmpname + ".png");
                            }
                        }
                    }
                    cishu++;
                    var js = MyFuncUtil.GetTimestamp();
                    MyFuncUtil.mylogandxianshi("模拟器" + dqinx + "循环" + cishu + "次数");
                    MyFuncUtil.mylogandxianshi("模拟器" + dqinx + "循环1次耗时" + MyFuncUtil.SecondToHour(js - ks));
                }
            }
        }