public IProxyHandle GetProxyHandle(string className) { IProxyHandle handle = null; handles.TryGetValue(className, out handle); return(handle); }
protected override void WebResponseHandle(string response, ICatchItem catchItem) { try { string className = (string)catchItem.Extend; IProxyHandle handle = proxyFactory.GetProxyHandle(className); if (handle == null) { return; } List <Proxy> proxyList = handle.DoHandle(response); if (proxyList == null) { return; } proxyList.ForEach(proxy => { httpUtil.VerifyProxy(proxy.Address, isSuccess => { if (isSuccess) { proxyHelper.Add(proxy); logger.InfoFormat("添加代理:{0}", proxy.Address.AbsoluteUri); } }); }); } catch (Exception ex) { logger.ErrorFormat("Error ProxyHandle:{0}", ex); } }