コード例 #1
0
        public static void Main(string[] args)
        {
            RssSmtpSection conf = (RssSmtpSection)ConfigurationManager.GetSection("rssSmtpGroup/rssSmtp");

            int interval = 10 * 1000;

            _transmitter = new Rss2Smtp(conf);

            Timer rssTimer = new Timer();

            rssTimer.Elapsed += new ElapsedEventHandler(UpdateEvent);
            rssTimer.Interval = interval;
            rssTimer.Start();

            string command = "";

            Console.Write(">_");
            while (!(command = Console.ReadLine()).Equals("exit"))
            {
                if (command.Equals("update"))
                {
                    _transmitter.Update();
                }
                Console.Write(">_");
            }

            rssTimer.Stop();
        }
コード例 #2
0
ファイル: Main.cs プロジェクト: bobrofon/rss2smtp
        public static void Main(string[] args)
        {
            RssSmtpSection conf = (RssSmtpSection) ConfigurationManager.GetSection("rssSmtpGroup/rssSmtp");

            int interval = 10 * 1000;
            _transmitter = new Rss2Smtp(conf);

            Timer rssTimer = new Timer();
            rssTimer.Elapsed += new ElapsedEventHandler(UpdateEvent);
            rssTimer.Interval = interval;
            rssTimer.Start();

            string command = "";
            Console.Write(">_");
            while(!(command = Console.ReadLine()).Equals("exit")) {
                if(command.Equals("update")) {
                    _transmitter.Update();
                }
                Console.Write(">_");
            }

            rssTimer.Stop();
        }