public string GetArchiveLink(GalleryInfo info) { IAsyncResult asyncResult = this.BeginGetArchiveLink(info, null); asyncResult.AsyncWaitHandle.WaitOne(); return(this.EndGetArchiveLink(asyncResult)); }
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)); }
public string GetArchiveLink(GalleryInfo info) { IAsyncResult asyncResult = this.BeginGetArchiveLink(info, null); asyncResult.AsyncWaitHandle.WaitOne(); return this.EndGetArchiveLink(asyncResult); }
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); }
public IAsyncResult BeginGetArchiveLink(GalleryInfo info, AsyncCallback callBack) { return this.BeginGetArchiveLink(info, callBack, null); }
public IAsyncResult BeginGetArchiveLink(GalleryInfo info, AsyncCallback callBack) { return(this.BeginGetArchiveLink(info, callBack, null)); }