访客统计

using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            StreamReader sr = new StreamReader(@"uv.txt", Encoding.Default);
            String line;
            List<String> lss = new List<String>();
            while ((line = sr.ReadLine()) != null)
            {
                string cl = new Regex(@"(?<=\s)\d+").Match(line).ToString();
                if (!lss.Contains(cl))
                {
                    lss.Add(cl);
                }
            }
            Console.WriteLine(lss.Count);
            Console.Read();
        }
    }
}
uv文件:https://files.cnblogs.com/files/tqlin/uv.zip
posted @ 2016-02-03 15:17  云天  阅读(254)  评论(0编辑  收藏  举报