示例#1
0
        private void DecodeCategory(string listUrl)//解析每一栏的标签页
        {
            Task task = new Task(() =>
            {
                var msg           = AnalyseTool.HttpGet(listUrl);
                decoder           = DecoderDistrution.GiveDecoder(listUrl);
                decoder.BackUrl   = listUrl;
                var cateCollect   = decoder.FindComicByCategory(msg);
                resource.NextPage = cateCollect.NextPageUrl;
                resource.LastPage = cateCollect.LastPageUrl;

                progressBar1.Invoke(new Action(() =>
                {
                    progressBar1.Value   = 0;
                    progressBar1.Maximum = cateCollect.ComicQueue.Count;
                    resultListView.Items.Clear();
                }));

                ViewStruct view = new ViewStruct();
                view.Queue      = cateCollect.ComicQueue;
                view.ViewAdd    = resultListView;

                if (m_exitLoad == false)
                {
                    m_exitLoad = true;
                }

                getThread = new Thread(new ParameterizedThreadStart(GetImagesList));
                getThread.Start(view);
            });

            task.Start();
        }
示例#2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            resource                 = new Resource();
            showImageList            = new ImageList();
            showImageList.ImageSize  = new Size(137, 174);
            showImageList.ColorDepth = ColorDepth.Depth32Bit;
            opt = new SqlOperate();
            string url = "http://m.90mh.com/update/";

            HotComic(url, DecoderDistrution.GiveDecoder(url));
        }
示例#3
0
        public void GetNetComic(DownLoadFile downFile)
        {
            Task task = new Task(() =>
            {
                FileStream file;
                var path           = "";
                var decoder        = DecoderDistrution.GiveDecoder(downFile.ComicUrl);
                var response       = AnalyseTool.HttpGet(downFile.ComicUrl);
                decoder.currentUrl = downFile.ComicUrl;
                var ds             = decoder.GetDownImageList(response);
                path = DownLoadPath + "\\" + ComicName + "\\";

                if (File.Exists(path) == false)
                {
                    Directory.CreateDirectory(path);
                }

                int errorCount = 0;
                int read       = 0;
                int count      = 0;

                foreach (var i in ds.ImageList)
                {
                    file       = new FileStream(path + (count++) + ".jpg", FileMode.Create);
                    var stream = DownLoad(i, SourceUrl);

                    while (stream == null && errorCount < 3)
                    {
                        Thread.Sleep(100);
                        stream = DownLoad(i, SourceUrl);
                        errorCount++;
                    }

                    byte[] buffer = new byte[32768];

                    while ((read = stream.Read(buffer, 0, buffer.Length)) > 0)
                    {
                        file.Write(buffer, 0, read);
                    }

                    if (addFileEvent != null)
                    {
                        addFileEvent(this, file.Name);
                    }

                    file.Flush();
                    stream.Flush();
                    file.Close();
                    stream.Close();
                }
            });

            task.Start();
        }
示例#4
0
        private void searchBtn_Click(object sender, EventArgs e)
        {
            var response = "";
            var url      = "";
            var name     = "";

            if (searchControl.Text == "")
            {
                return;
            }

            var keyWord = HttpUtility.UrlEncode(searchControl.Text, Encoding.UTF8);

            foreach (RadioButton r in flowControl.Controls)
            {
                if (r.Checked)
                {
                    name = r.Name;
                    break;
                }
            }

            SetGifVisable();

            Task task = new Task(() =>
            {
                lock (getLock)
                {
                    switch (name)
                    {
                    case "hanhanCheck": url = "http://www.hhimm.com/comic/?act=search&st=" + keyWord; break;

                    case "manhuarenCheck": url = "http://www.1kkk.com/search?title=" + keyWord; break;

                    case "k886Check": url = "https://www.k886.net/search-index?searchType=1&q=" + keyWord; break;

                    case "jiulingCheck": url = "http://m.90mh.com/search/?keywords=" + keyWord; break;

                    case "veryDmCheck": url = "http://www.veryimapp.com/index.php?r=comic%2Fsearch&keyword=" + keyWord; break;

                    case "manhuaduiCheck": url = "https://www.manhuadui.com/search/?keywords=" + keyWord; break;

                    case "mangebzCheck": url = "http://www.mangabz.com/search?title=" + keyWord; break;
                    }

                    response = AnalyseTool.HttpGet(url);
                    decoder  = DecoderDistrution.GiveDecoder(url);
                    SearchComic(response);
                }
            });

            task.Start();
        }
示例#5
0
        private void button1_Click_1(object sender, EventArgs e)
        {
            Task task = new Task(() =>
            {
                while (true)
                {
                    string url = "http://www.mangabz.com";
                    url        = "http://m.90mh.com/update/";
                    decoder    = DecoderDistrution.GiveDecoder(url);
                    HotComic(url, decoder);
                    Thread.Sleep(1000 * 20);
                }
            });

            task.Start();

            //string url = "http://www.mangabz.com/m10344/";
            //url = "http://www.mangabz.com/m115462/";
            //var response = AnalyseTool.HttpGet(url);
            //PublicThing decoder = DecoderDistrution.GiveDecoder(url);
            //decoder.GetDownImageList(response);
        }
示例#6
0
        private void searchBtn_Click(object sender, EventArgs e)
        {
            var response = "";
            var url      = "";
            var name     = "";
            var keyWord  = HttpUtility.UrlEncode(searchControl.Text, Encoding.UTF8);

            RadioButton[] radio = { k886Check, kanCheck, hanhanCheck, jingmingyanCheck };

            foreach (RadioButton r in radio)
            {
                if (r.Checked)
                {
                    name = r.Name;
                    break;
                }
            }

            Task task = new Task(() =>
            {
                switch (name)
                {
                case "hanhanCheck": url = "http://www.hhmmoo.com/comic/?act=search&st=" + keyWord; break;

                //case "jingmingyanCheck": url = "http://www.jmydm.com/comic/s.aspx"; response = AnalyseTool.PostWebRequest(url, "tbSTxt=" + keyWord);break;
                case "kanCheck": url = "http://www.manhuagui.com/s/" + keyWord + ".html"; break;

                case "k886Check": url = "https://www.k886.net/search-index?searchType=1&q=" + keyWord; break;
                }

                response = AnalyseTool.HttpGet(url);
                decoder  = DecoderDistrution.GiveDecoder(url);
                SearchComic(response);
            });

            task.Start();
        }
示例#7
0
        void downItem_resumeDownLoadEvent(object sender, EventArgs args)//继续下载
        {
            DownTask    task    = null;
            DownListBox listBox = sender as DownListBox;

            foreach (var i in taskQueue)
            {
                if (i.ComicName == listBox.Title)
                {
                    task = i;
                }
            }

            if (task == null)
            {
                SqlOperate operate = new SqlOperate();
                operate.CreateOrOpenDataBase("task.db");
                var list = operate.GetRecordList();

                foreach (var i in list)
                {
                    if (i.TaskName == listBox.Title)
                    {
                        List <DownLoadFile> downList = new List <DownLoadFile>();
                        DownLoadFile        file     = new DownLoadFile();
                        file.ComicName = i.TaskName;
                        file.ComicUrl  = i.Url;
                        file.SavePath  = i.Path;
                        downList.Add(file);
                        StartNewDownLoad(downList, DecoderDistrution.GiveDecoder(i.Url), i.DownLoadProgress - 1);
                    }
                }

                operate.CloseDataBase();
            }
        }
示例#8
0
        private void FillComicInfo(ListView selectView)
        {
            var receive = "";
            var url     = "";

            if (selectView.SelectedItems == null)
            {
                return;
            }

            ListViewItemInfo item = null;

            this.Invoke(new Action(() =>
            {
                item = selectView.SelectedItems[0] as ListViewItemInfo;
                mainFrame.SelectedPageIndex = 1;
                comicNameLabel.Text         = "漫画名:" + item.Text;
                comicPicBox.Image           = showImageList.Images[selectView.SelectedItems[0].Index];
                url = item.ReferUrl;
                resource.ComicName = item.Text;
                resource.ComicHref = url;
                currentItem        = item;
            }));

            //ShowWait(checkPanel);
            decoder = DecoderDistrution.GiveDecoder(url);
            receive = AnalyseTool.HttpGet(url);
            //RemoveWait(checkPanel);

            if (receive == "")
            {
                MessageBox.Show("网络错误,获取失败");
                return;
            }

            var comicInfo = decoder.GetComicInfo(receive);

            item.UrlDictronary = comicInfo.URLDictionary;

            this.Invoke(new Action(() =>
            {
                authorLab.Text = (comicInfo.Author == null || comicInfo.Author.Length == 0) ? "略" : comicInfo.Author;
                tagLabe.Text   = "标签:  " + comicInfo.Tag;
                descLable.Text = "简介:" + comicInfo.Description;
                statusLab.Text = "连载状态:" + comicInfo.HasFinished;
                checkPanel.Controls.Clear();

                if (comicInfo.URLDictionary == null)
                {
                    descLable.Text = "简介:" + "该漫画已经下架!";
                    return;
                }

                List <Controls.CheckBoxEx> list = new List <Controls.CheckBoxEx>();

                foreach (var i in comicInfo.URLDictionary)
                {
                    var checkBox  = new Controls.CheckBoxEx();
                    checkBox.Text = i.Key;
                    list.Add(checkBox);
                }
                checkPanel.Controls.AddRange(list.ToArray());
                SetGifHidden();
            }));
        }
示例#9
0
        private void comicNavBar_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            string url = "";

            if (e.Link.Caption == "分类")
            {
                switch (e.Link.Group.Name)
                {
                case "jingmingyan": url = "http://www.jmydm.com/ManhuaClass-LangmanAiqing/"; break;

                case "kanmanhua": url = "https://www.manhuagui.com/list/wanjie/"; break;

                case "hanhanmanhua": url = "http://www.hhimm.com/comic/class_1.html"; break;

                case "dongman": url = "http://www.dmzx.com/rexue-all-all-all-all/"; break;

                case "yylsmanhua": url = "http://8comic.se/category/%E6%BC%AB%E7%95%AB%E5%88%86%E9%A1%9E/%E5%86%92%E9%9A%AA/"; break;

                case "k886": url = "https://www.k886.net/index-html-status-0-typeid-0-sort-"; break;

                case "feichangaiman": url = "http://comic.veryim.com/all/"; break;

                case "manhuaren": url = "http://www.1kkk.com/manhua-list/"; break;

                case "jiu0ManHua": url = "http://m.90mh.com/search/"; break;

                case "veryDm": url = "http://www.veryimapp.com/index.php?r=comic/list&show=grid&sort=update"; break;

                case "huhumanhua": url = "http://www.huhudm.com/comic/"; break;

                case "manhuadui": url = "https://www.manhuadui.com/list/riben/"; break;

                case "mangabzName": url = "http://www.mangabz.com/manga-list/"; break;
                }

                if (url.Length > 0)
                {
                    decoder = DecoderDistrution.GiveDecoder(url);
                    FenLei(url, decoder);
                }
            }
            else
            {
                if (e.Link.Caption == "热门")
                {
                    switch (e.Link.Group.Name)
                    {
                    //case "jingmingyan": url = "http://www.jmydm.com"; break;
                    case "kanmanhua": url = "https://www.manhuagui.com"; break;

                    case "hanhanmanhua": url = "http://www.hhimm.com/"; break;

                    case "yylsmanhua": url = "http://8comic.se/"; break;

                    case "dongman": url = "http://www.dmzx.com/"; break;

                    case "k886": url = "https://www.k886.net/"; break;

                    case "feichangaiman": url = "http://www.verydm.com/"; break;

                    case "manhuaren": url = "http://www.1kkk.com/manhua-jp/"; break;

                    case "manhuadui": url = "https://www.manhuadui.com/list/riben/"; break;

                    case "huhumanhua": url = "http://www.huhudm.com/"; break;

                    case "veryDm": url = "http://www.veryimapp.com/"; break;

                    case "jiu0ManHua": url = "http://m.90mh.com/update/"; break;

                    case "mangabzName": url = "http://www.mangabz.com"; break;
                        //case "jiu0ManHua": url = "http://m.90mh.com/update/"; break;
                    }

                    if (url.Length > 0)
                    {
                        decoder = DecoderDistrution.GiveDecoder(url);
                        HotComic(url, decoder);
                    }
                }
            }
        }
示例#10
0
        private void FillComicInfo(ListView selectView)
        {
            int x       = 0;
            int y       = 0;
            var receive = "";

            mainFrame.SelectedPageIndex = 1;
            comicNameLabel.Text         = "漫画名:" + selectView.SelectedItems[0].Text;
            var url = resourse.SearchResultURL[selectView.SelectedItems[0].Text];

            resourse.ComicName = selectView.SelectedItems[0].Text;
            resourse.ComicHref = url;
            decoder            = DecoderDistrution.GiveDecoder(url);
            receive            = AnalyseTool.HttpGet(url);

            if (receive == "")
            {
                MessageBox.Show("网络错误,获取失败");
                return;
            }
            var comicInfo = decoder.GetComicInfo(receive);

            downUrlDic        = new Dictionary <string, string>();//存储当前漫画所有图片链接
            downUrlDic        = comicInfo.URLDictionary;
            comicPicBox.Image = showImageList.Images[selectView.SelectedItems[0].Index];
            authorLab.Text    = (comicInfo.Author == null || comicInfo.Author.Length == 0)? "略":comicInfo.Author;
            tagLabe.Text      = "标签:  " + comicInfo.Tag;
            descLable.Text    = "简介:" + comicInfo.Description;
            statusLab.Text    = "连载状态:" + comicInfo.HasFinished;
            CheckBox check;

            checkPanel.Controls.Clear();

            Task task = new Task(() =>
            {
                foreach (var i in comicInfo.URLDictionary)
                {
                    check          = new CheckBox();
                    check.AutoSize = true;
                    check.Text     = i.Key;
                    check.Location = new Point(x, y);

                    this.Invoke(new Action(() =>
                    {
                        checkPanel.Controls.Add(check);
                    }));


                    if (x + check.Width + 5 > checkPanel.Width - check.Width - 10)//如果
                    {
                        x = 0;
                        y = y + check.Height + 20;
                    }
                    else
                    {
                        x = x + check.Width + 5;
                    }
                }
            });

            task.Start();
        }