Beispiel #1
0
 public void Start()
 {
     try
     {
         String             content = File.ReadAllText(textSrc.Text.Replace("\"", ""));
         List <HunterProxy> proxies = new List <HunterProxy>();
         proxies = HunterProxy.GetProxy(content);
         AnalyzeProxies(proxies, textDest.Text);
     }
     catch (System.Exception ex)
     {
         MessageBox.Show(ex.Message, "Hunter 3", MessageBoxButtons.OK, MessageBoxIcon.Error);
         btnStart.Enabled = true;
     }
 }
Beispiel #2
0
        public static List <HunterProxy> GetProxy(String r)
        {
            List <HunterProxy> ResultList = new List <HunterProxy>();
            Regex regex = new Regex(StrRegex);
            Match m     = regex.Match(r);

            while (m.Success)
            {
                bool        Legal     = true;
                HunterProxy tempProxy = new HunterProxy();
                tempProxy.IPAndPort   = m.Result("${ipandport}");
                tempProxy.Type        = m.Result("${type}");
                tempProxy.Speed       = m.Result("${speed}");
                tempProxy.Description = m.Result("${description}").Replace("\n", "").Replace("\r", "").Trim();

                if (Legal)
                {
                    ResultList.Add(tempProxy);
                }
                m = m.NextMatch();
            }

            return(ResultList);
        }