static void Main(string[] args) { Thread t = new Thread(RefreshUI); t.Start(); BookSpider bookSpider = new BookSpider(10000000, 100000000, 1000); bookSpider.OnProceed += BookSpider_OnProceed; bookSpider.OnCompleted += BookSpider_OnCompleted; bookSpider.Run(); Console.Read(); }
public IActionResult Index() { BookSpider spider = new BookSpider(); spider.StrCookie = GetbookcookieAsync().Result; System.Xml.Linq.XDocument message = new System.Xml.Linq.XDocument(); spider.Run(); foreach (IPipeline item in spider.Pipelines) { message = item.ResponseMessage; } if (message == null) { return(Redirect(Url.Action("Error", "Home"))); } Response.ContentType = "application/xml"; return(Content(message.ToString())); }