示例#1
0
        private IList <ProxyItem> GetProxyList(string proxyFile)
        {
            IList <ProxyItem> proxyList = new List <ProxyItem>();

            if (string.IsNullOrEmpty(proxyFile) || !File.Exists(proxyFile))
            {
                return(proxyList);
            }

            using (StreamReader sr = new StreamReader(proxyFile))
            {
                string ip    = string.Empty;
                int    port  = 0;
                int    index = 1;

                while (!sr.EndOfStream)
                {
                    string line = sr.ReadLine();
                    if (TextToItemHelper.GetProxy(line, ref ip, ref port))
                    {
                        ProxyItem item = new ProxyItem(ip, port)
                        {
                            ID = index++
                        };
                        proxyList.Add(item);
                    }
                }
            }
            return(proxyList);
        }
示例#2
0
        private IList <ItemBase> LoadUser()
        {
            IList <ItemBase> list = new List <ItemBase>();

            using (StreamReader sr = new StreamReader(filePath))
            {
                string user  = string.Empty;
                string pwd   = string.Empty;
                string email = string.Empty;

                while (!sr.EndOfStream)
                {
                    string line = sr.ReadLine();
                    if (TextToItemHelper.GetLoginAccountItem(line, ref user, ref pwd, ref email,
                                                             DataFormat.AccountPassword, WowLogManager.Instance))
                    {
                        ItemBase item = new ItemBase()
                        {
                            RawData  = line,
                            User     = user,
                            Password = pwd
                        };
                        list.Add(item);
                    }
                }
            }

            return(list);
        }