Пример #1
0
        //public bool ShowExplicit { get; set; }

        //public virtual bool IsSupportCount { get { return true; } }
        //public virtual bool IsSupportScore { get { return true; } }
        //public virtual bool IsSupportRes { get { return true; } }
        //public virtual bool IsSupportPreview { get { return true; } }
        //public virtual bool IsSupportJpeg { get { return true; } }
        //public virtual bool IsSupportTag { get { return true; } }

        //public virtual System.Drawing.Point LargeImgSize { get { return new System.Drawing.Point(SWIDTH, SWIDTH); } }
        //public virtual System.Drawing.Point SmallImgSize { get { return new System.Drawing.Point(SWIDTH, SHEIGHT); } }

        /// <summary>
        /// get images sync
        /// </summary>
        //public virtual List<Img> GetImages(int page, int count, string keyWord, int maskScore, int maskRes, ViewedID lastViewed, bool maskViewed, System.Net.IWebProxy proxy, bool showExplicit)
        //{
        //    return GetImages(GetPageString(page, count, keyWord, proxy), maskScore, maskRes, lastViewed, maskViewed, proxy, showExplicit);
        //}

        public override string GetPageString(int page, int count, string keyWord, System.Net.IWebProxy proxy)
        {
            string url = string.Format(siteUrl, needMinus ? page - 1 : page, count, keyWord);

            if (keyWord.Length == 0)
            {
                url = url.Substring(0, url.Length - 6);
            }

            /*
             *  System.Net.HttpWebRequest req = (System.Net.HttpWebRequest)System.Net.WebRequest.Create(url);
             * req.UserAgent = "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)";
             * req.Proxy = proxy;
             * req.Timeout = 8000;
             * req.Method = "GET";
             * req.ReadWriteTimeout = 8000;
             * req.KeepAlive = true;
             * req.UseDefaultCredentials = true;
             * //prevent 303 See Other
             * req.AllowAutoRedirect = true;
             *          System.Net.WebResponse rsp = req.GetResponse();
             */

            MoeLoader.MyWebClient web = new MoeLoader.MyWebClient();
            web.Proxy = proxy;

            web.Encoding = Encoding.UTF8;
            //Debug.WriteLine("======>DownloadString ==========>" + url);
            url = "https://yande.re/";
            string pageString = web.DownloadString(url);

            web.Dispose();

            return(pageString);
        }
Пример #2
0
        //public bool ShowExplicit { get; set; }

        //public virtual bool IsSupportCount { get { return true; } }
        //public virtual bool IsSupportScore { get { return true; } }
        //public virtual bool IsSupportRes { get { return true; } }
        //public virtual bool IsSupportPreview { get { return true; } }
        //public virtual bool IsSupportJpeg { get { return true; } }
        //public virtual bool IsSupportTag { get { return true; } }

        //public virtual System.Drawing.Point LargeImgSize { get { return new System.Drawing.Point(SWIDTH, SWIDTH); } }
        //public virtual System.Drawing.Point SmallImgSize { get { return new System.Drawing.Point(SWIDTH, SHEIGHT); } }

        /// <summary>
        /// get images sync
        /// </summary>
        //public virtual List<Img> GetImages(int page, int count, string keyWord, int maskScore, int maskRes, ViewedID lastViewed, bool maskViewed, System.Net.IWebProxy proxy, bool showExplicit)
        //{
        //    return GetImages(GetPageString(page, count, keyWord, proxy), maskScore, maskRes, lastViewed, maskViewed, proxy, showExplicit);
        //}

        public override string GetPageString(int page, int count, string keyWord, System.Net.IWebProxy proxy)
        {
            string url = string.Format(siteUrl, needMinus ? page - 1 : page, count, keyWord);
            if (keyWord.Length == 0)
            {
                url = url.Substring(0, url.Length - 6);
            }

            MoeLoader.MyWebClient web = new MoeLoader.MyWebClient();
            web.Proxy = proxy;

            web.Encoding = Encoding.UTF8;
            string pageString = web.DownloadString(url);
            web.Dispose();

            return pageString;
        }
Пример #3
0
        //public bool ShowExplicit { get; set; }

        //public virtual bool IsSupportCount { get { return true; } }
        //public virtual bool IsSupportScore { get { return true; } }
        //public virtual bool IsSupportRes { get { return true; } }
        //public virtual bool IsSupportPreview { get { return true; } }
        //public virtual bool IsSupportJpeg { get { return true; } }
        //public virtual bool IsSupportTag { get { return true; } }

        //public virtual System.Drawing.Point LargeImgSize { get { return new System.Drawing.Point(SWIDTH, SWIDTH); } }
        //public virtual System.Drawing.Point SmallImgSize { get { return new System.Drawing.Point(SWIDTH, SHEIGHT); } }

        /// <summary>
        /// get images sync
        /// </summary>
        //public virtual List<Img> GetImages(int page, int count, string keyWord, int maskScore, int maskRes, ViewedID lastViewed, bool maskViewed, System.Net.IWebProxy proxy, bool showExplicit)
        //{
        //    return GetImages(GetPageString(page, count, keyWord, proxy), maskScore, maskRes, lastViewed, maskViewed, proxy, showExplicit);
        //}

        public override string GetPageString(int page, int count, string keyWord, System.Net.IWebProxy proxy)
        {
            string url = string.Format(siteUrl, needMinus ? page - 1 : page, count, keyWord);

            if (keyWord.Length == 0)
            {
                url = url.Substring(0, url.Length - 6);
            }

            MoeLoader.MyWebClient web = new MoeLoader.MyWebClient();
            web.Proxy = proxy;

            web.Encoding = Encoding.UTF8;
            string pageString = web.DownloadString(url);

            web.Dispose();

            return(pageString);
        }