示例#1
0
        public string GetArchiveLink(GalleryInfo info)
        {
            IAsyncResult asyncResult = this.BeginGetArchiveLink(info, null);

            asyncResult.AsyncWaitHandle.WaitOne();
            return(this.EndGetArchiveLink(asyncResult));
        }
示例#2
0
        public IAsyncResult BeginGetArchiveLink(GalleryInfo info, AsyncCallback callBack, object userState)
        {
            if (info.ArchiverKeyTime < DateTime.UtcNow)
            {
                throw new Exception("Archiver Key Time is expired.");
            }

            string url = String.Format(
                "http://exhentai.org/archiver.php?gid={0}&token={1}&or={2}",
                info.token.gid,
                info.token.token,
                info.ArchiverKey);

            HttpWebRequest wReq = WebRequest.Create(url) as HttpWebRequest;

            wReq.Proxy  = this.Proxy;
            wReq.Method = "POST";
            wReq.Headers.Set("cookie", this.m_cookie);
            wReq.Referer     = url;
            wReq.ContentType = "application/x-www-form-urlencoded";

            return(new ApiResult(wReq, ArchiveLinkData, ExHentai.KeyArchiveLink, callBack, userState));
        }
示例#3
0
 public string GetArchiveLink(GalleryInfo info)
 {
     IAsyncResult asyncResult = this.BeginGetArchiveLink(info, null);
     asyncResult.AsyncWaitHandle.WaitOne();
     return this.EndGetArchiveLink(asyncResult);
 }
示例#4
0
        public IAsyncResult BeginGetArchiveLink(GalleryInfo info, AsyncCallback callBack, object userState)
        {
            if (info.ArchiverKeyTime < DateTime.UtcNow)
                throw new Exception("Archiver Key Time is expired.");

            string url = String.Format(
                        "http://exhentai.org/archiver.php?gid={0}&token={1}&or={2}",
                        info.token.gid,
                        info.token.token,
                        info.ArchiverKey);

            HttpWebRequest wReq = WebRequest.Create(url) as HttpWebRequest;
            wReq.Proxy = this.Proxy;
            wReq.Method = "POST";
            wReq.Headers.Set("cookie", this.m_cookie);
            wReq.Referer = url;
            wReq.ContentType = "application/x-www-form-urlencoded";

            return new ApiResult(wReq, ArchiveLinkData, ExHentai.KeyArchiveLink, callBack, userState);
        }
示例#5
0
 public IAsyncResult BeginGetArchiveLink(GalleryInfo info, AsyncCallback callBack)
 {
     return this.BeginGetArchiveLink(info, callBack, null);
 }
示例#6
0
 public IAsyncResult BeginGetArchiveLink(GalleryInfo info, AsyncCallback callBack)
 {
     return(this.BeginGetArchiveLink(info, callBack, null));
 }