protected WebProxy GetProxy() { if (SendCacheStore.GetSystemValue("proxyenable") == "true") { var proxyurl = SendCacheStore.GetSystemValue("proxy"); if (proxyurl != null) { WebProxy proxy = new WebProxy { Address = new Uri(proxyurl) }; return(proxy); } } return(null); }
public void Run() { var sendthread = SendCacheStore.GetSystemValue("sendthread"); int.TryParse(sendthread, out int threadCount); threadCount = threadCount <= 0 ? 1 : threadCount; for (int i = 0; i < threadCount; i++) { Thread thread = null; thread = new Thread(e => { SendWork(thread); }) { IsBackground = true, Priority = ThreadPriority.Highest }; thread.Start(); m_sendThreads.Add(thread); } }