Exemplo n.º 1
0
 public void ProcessRequest(HttpContext context)
 {
     context.Response.ContentType = "text/plain";
     //context.Response.Write("Hello World");
     //JsonConvert.DeserializeObject(context.Request.Params.ToString());
     Params pars = new Params();
     pars.Key = context.Request.Params["key"];
     pars.Addr = context.Request.Params["addr"];
     pars.From = context.Request.Params["from"];
     pars.Page = context.Request.Params["page"];
     List<JobInfo> list = GetList(pars);
     context.Response.Write(JsonConvert.SerializeObject(list));
 }
Exemplo n.º 2
0
        private List<JobInfo> GetList(Params pars)
        {
            List<JobInfo> jobList = new List<JobInfo>();
            List<IZhaoPin> zhaoPing = new List<IZhaoPin>();
            var threads = new List<Thread>();
            if (pars.From.Contains("zlzp"))
            {
                var zlzp = new Zlzp(pars);
                var zlzpThread = new Thread(zlzp.GetJobListFromWeb);
                zlzpThread.Start();
                threads.Add(zlzpThread);
                zhaoPing.Add(zlzp);
            }
            if (pars.From.Contains("qcwy"))
            {
                var qcwy = new Qcwy(pars);
                var qcwyThread = new Thread(qcwy.GetJobListFromWeb);
                qcwyThread.Start();
                threads.Add(qcwyThread);
                zhaoPing.Add(qcwy);
            }
            if (pars.From.Contains("lpw"))
            {
                var lpw = new Lpw(pars);
                var lpwThread = new Thread(lpw.GetJobListFromWeb);
                lpwThread.Start();
                threads.Add(lpwThread);
                zhaoPing.Add(lpw);
            }
            foreach (var v in threads)
            {
                v.Join();
            }
               foreach (var v in zhaoPing)
               {
               jobList.AddRange(v.GetJobList());
               }

            return jobList;
        }
Exemplo n.º 3
0
 public Zlzp(Params pars)
 {
     _pars = pars;
 }
Exemplo n.º 4
0
 public Lpw(Params pars)
 {
     _pars = pars;
 }