예제 #1
0
        private void sendExampleRequestOrder()
        {
            string[] exam = { "debugful", "http://w6.loxa.edu.tw/a13302001/000.png", "", "3" };
            exam[2] = FBDialog1.SelectedPath;
            RqOrder order;

            sendDebugMSGToConsole("BackgroundWorker has Charged");
            inteveneUIwithThread("3/BackgroundWorker has Charged");
            switch (Convert.ToInt16(requestValueFromUI(0)))
            {
            case 0:
                order = new RqOrder(exam[0], exam[1], exam[2], RqOrder.BASE_ON_FINAL_EPNUM);
                order.addURLs(exam[3]);
                Udler = new UDdler(order);
                Udler.doDownloadMethod(2, true);
                sendDebugMSGToConsole("Download Request has Send");
                Thread.Sleep(5000);
                break;

            case 1:
                order = new RqOrder(exam[0], exam[1], exam[2], RqOrder.BASE_ON_FINAL_EPNUM, true);
                order.addURLs(exam[3]);
                Udler = new UDdler(order);
                Udler.doDownloadMethod(2, true);
                sendDebugMSGToConsole("Download Request has Send");
                Thread.Sleep(5000);
                break;

            case 2:
                order = new RqOrder(exam[0], exam[1], exam[2], RqOrder.BASE_ON_ALL_PAGEURL);
                for (int num = 1; num <= Convert.ToInt16(exam[3]); num++)
                {
                    order.addURLs("http://w6.loxa.edu.tw/a13302001/00" + Convert.ToString(num) + ".png");
                }
                Udler = new UDdler(order);
                Udler.doDownloadMethod(1, true);
                sendDebugMSGToConsole("Download Request has Send");
                Thread.Sleep(5000);
                break;

            case 3:
                order = new RqOrder(exam[0], exam[1], exam[2], RqOrder.BASE_ON_ALL_PAGEURL, true);
                for (int num = 1; num <= Convert.ToInt16(exam[3]); num++)
                {
                    order.addURLs("http://w6.loxa.edu.tw/a13302001/00" + Convert.ToString(num) + ".png");
                }
                Udler = new UDdler(order);
                Udler.doDownloadMethod(1, true);
                sendDebugMSGToConsole("Download Request has Send");
                Thread.Sleep(5000);
                break;

            default:
                inteveneUIwithThread("3/ERROR Rising On DownloadRule");
                sendDebugMSGToConsole("We get Download Rule Value: " + requestValueFromUI(0));
                break;
            }
        }
예제 #2
0
 public UDdler(RqOrder RO)
 {
     PicSname.AddRange(new string[] { "png", "jpg", "bmp", "gif" });
     pack         = RO;
     isDlFinished = false;
     hasStarted   = false;
     DlTotalPrg   = RO.getAllPageNumber();
     DlProgress   = 0;
     wc           = new WebClient();
 }
예제 #3
0
        //Build & Sent Request methods
        private void sendRequestOrder()
        {
            RqOrder order;
            string  v1 = TitlettBox.Text;
            string  v2 = FPUrlTtBox.Text;
            string  v3 = FBDialog1.SelectedPath;

            //Thread.Sleep(3000);
            switch (Convert.ToInt16(requestValueFromUI(0)))
            {
            case 0:
                order = new RqOrder(v1, v2, v3, RqOrder.BASE_ON_FINAL_EPNUM);
                order.addURLs(Convert.ToString(DldataView.Rows[0].Cells[1].FormattedValue));
                Udler = new UDdler(order);
                Udler.doDownloadMethod(2, false);
                break;

            case 1:
                order = new RqOrder(v1, v2, v3, RqOrder.BASE_ON_FINAL_EPNUM, true);
                order.addURLs(Convert.ToString(DldataView.Rows[0].Cells[1].FormattedValue));
                Udler = new UDdler(order);
                Udler.doDownloadMethod(2, false);
                break;

            case 2:
                order = new RqOrder(v1, v2, v3, RqOrder.BASE_ON_ALL_PAGEURL);
                for (int CrtNum = 0; CrtNum < DldataView.Rows.Count; CrtNum++)
                {
                    order.addURLs(Convert.ToString(DldataView.Rows[CrtNum].Cells[1].FormattedValue));
                }
                Udler = new UDdler(order);
                Udler.doDownloadMethod(1, false);
                break;

            case 3:
                order = new RqOrder(v1, v2, v3, RqOrder.BASE_ON_ALL_PAGEURL, true);
                order.addURLs(Convert.ToString(DldataView.Rows[0].Cells[1].FormattedValue));
                Udler = new UDdler(order);
                Udler.doDownloadMethod(2, false);
                break;

            default:
                inteveneUIwithThread("3/ERROR Rising On DownloadRule");
                sendDebugMSGToConsole("We get Download Rule Value: " + requestValueFromUI(0));
                break;
            }
        }