public DbMonitor(IAppBase app, bool isDbOnly = false) { App = app; _isDbOnly = isDbOnly; if (Core.Env.SystemConnectionStringSettings != null) { using (var conn = Core.Env.SystemConnectionStringSettings.GetDbConnection()) { InitStatusDatabase(conn); var insertSql = "insert ignore into DotnetSpider.Status (`TaskId`,`Identity`, `NodeId`, `Logged`, `Status`, `Thread`, `Left`, `Success`, `Error`, `Total`, `AvgDownloadSpeed`, `AvgProcessorSpeed`, `AvgPipelineSpeed`) values (@TaskId,@Identity, @NodeId, current_timestamp, @Status, @Thread, @Left, @Success, @Error, @Total, @AvgDownloadSpeed, @AvgProcessorSpeed, @AvgPipelineSpeed);"; conn.MyExecute(insertSql, new { TaskId = App.TaskId, Identity = App.Identity, NodeId = NodeId.Id, Status = "INIT", Left = 0, Total = 0, Success = 0, Error = 0, AvgDownloadSpeed = 0, AvgProcessorSpeed = 0, AvgPipelineSpeed = 0, Thread = 0 }); } } }
private void AnimeDownload(argumentList args, int ti, Action <int, string> u) { VideoBase e = new VideoBase(args, ti, u); _base = e; e.BeginExecution(); return; }
public override string GetText(Chapter chp, HtmlDocument use, WebClient wc) { wc.Headers = IAppBase.GenerateHeaders(chp.chapterLink.Host); string dwnld = wc.DownloadString(chp.chapterLink); use.LoadHtml(dwnld); GC.Collect(); return(use.DocumentNode.FindAllNodes().GetFirstElementByClassNameA("chp_raw").InnerText); }
public HomeController(UserManager <ApplicationUser> userManager, SignInManager <ApplicationUser> signInManager, IConfiguration configuration, IAppBase <User, UserDTO> app, ApplicationDbContext contexto, IMapper mapper) { _userManager = userManager; _signInManager = signInManager; _configuration = configuration; this.app = app; _contexto = contexto; _iMapper = mapper; }
public static bool StartAllApps() { List <ContainerRegistration> regs = _theContainer.Registrations.Where(reg => reg.Name != null && reg.Name.StartsWith("App")).ToList(); foreach (var reg in regs) { IAppBase appBase = _theContainer.Resolve <IAppBase>(reg.Name); appBase.Start(); } return(true); }
public override string GetText(Chapter chp, HtmlDocument use, WebClient wc) { HtmlNodeCollection b; StringBuilder sb = new StringBuilder(); // Git controls in visual studio are f*****g horrible, and I had to rewrite this TWICE. Only if Git Bash wasn't being deprecated... wc.Headers = IAppBase.GenerateHeaders(chp.chapterLink.Host); string dwnld; Retry :; try { dwnld = wc.DownloadString(chp.chapterLink); } catch { goto Retry; } use.LoadHtml(dwnld); b = use.DocumentNode.SelectNodes("//div[contains(@class, 'chapter-c')]"); HtmlNode[] scripts = b[0].DescendantNodes().Where(x => x.XPath.Contains("/script")).ToArray(); foreach (HtmlNode n in scripts) { n.RemoveAll(); } use.LoadHtml(b[0].InnerHtml); b = use.DocumentNode.SelectNodes("//text()[normalize-space(.) != '']"); foreach (HtmlNode htmln in b) { sb.AppendLine(htmln.InnerText + "\n"); } GC.Collect(); return(HttpUtility.HtmlDecode(sb.ToString())); }
static void ListenerCallback(IAsyncResult result) { HttpRequestContext = listener.EndGetContext(result); string[] urlParamStr = new string[0]; //HttpRequestContext.Response.StatusCode = 200; //HttpRequestContext.Response.StatusDescription = "OK"; string url = HttpRequestContext.Request.Url.ToString(); appUrl = url.Replace(baseUrl, string.Empty); IAppBase theApp = RequestFilter.DoMapping(appUrl); if (theApp == default(AppBase)) { return; } urlParamStr = new string[1]; urlParamStr[0] = appUrl; string appResponseStr = theApp.HandleRequest(urlParamStr); var buffer = System.Text.Encoding.UTF8.GetBytes(appResponseStr); HttpRequestContext.Response.ContentLength64 = buffer.Length; var output = HttpRequestContext.Response.OutputStream; output.Write(buffer, 0, buffer.Length); output.Close(); HttpRequestContext.Response.Close(); return; }
static void MainServer() { //Server Root Folder //String sMyWebServerRoot = "C:\\WebServerRoot\\"; Console.WriteLine("Server"); listener = new HttpListener(); listener.Prefixes.Add(baseUrl); listener.AuthenticationSchemes = AuthenticationSchemes.Anonymous; listener.Start(); AppLifecycleManager.RegisterApp <IAppBase, AppFibonacci>("AppFibonacci"); AppLifecycleManager.RegisterApp <IAppBase, AppTextFileReader>("AppTextFileReader"); AppLifecycleManager.RegisterApp <IAppBase, AppIndex>("AppIndex"); AppLifecycleManager.RegisterApp <IAppBase, AppNotFound>("AppNotFound"); IAppBase appfin = AppLifecycleManager.Resolve <IAppBase>("AppFibonacci"); appfin.Start(); IAppBase apptex = AppLifecycleManager.Resolve <IAppBase>("AppTextFileReader"); apptex.Start(); IAppBase appindex = AppLifecycleManager.Resolve <IAppBase>("AppIndex"); //appindex.Start(); IAppBase apperror = AppLifecycleManager.Resolve <IAppBase>("AppNotFound"); apperror.Start(); while (true) { ProcessRequest(); } }
public HttpMonitor(IAppBase app) { App = app; }
public BaseController(IAppBase <Entidade, EntidadeDTO> appBase) { _appBase = appBase; }
public ReportController( IAppBase <Report, ReportDTO> app, IReportApp reportApp) : base(app) { _reportApp = reportApp; }
public ClientesController(IAppBase <Client, ClienteDTO> app) : base(app) { }
public ControllerBase(IAppBase <Entidade, EntidadeDTO> app) { _app = app; }
public ControllerBase(IAppBase <Entity, EntityDTO> app) { this.app = app; }
public UserController(IAppBase <User, UserDTO> app) : base(app) { }
public ControllerBaseController(IAppBase <Entidade, EntidadeDTO> app) { this.app = app; }
public Base(IAppBase <Entidade, EntidadeDTO> app) { this.app = app; }