コード例 #1
0
        static void Main(string[] args)
        {
            Console.WriteLine("Executing the WeatherLogger Task....");

            // Set the xml url
            string url = "http://w1.weather.gov/xml/current_obs/KEWR.xml";
            string XmlStr;

            // Create the DownloadXML object
            DownloadXML XmlObj = new DownloadXML(url);


            XmlStr = XmlObj.DownloadWeatherXML();


            if (XmlStr == null)
            {
                Environment.Exit(0);
            }
            else
            {
                InsertIntoDb DbObj = new InsertIntoDb();
                DbObj.InsertData(XmlStr);
            }

            Console.WriteLine("Done");
            //Console.Read();
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: tkmallik/WeatherLogger
        static void Main(string[] args)
        {
            Console.WriteLine("Executing the WeatherLogger Task....");

                // Set the xml url
                string url = "http://w1.weather.gov/xml/current_obs/KEWR.xml";
                string XmlStr;

                // Create the DownloadXML object
                DownloadXML XmlObj = new DownloadXML(url);

                XmlStr = XmlObj.DownloadWeatherXML();

                if (XmlStr == null)
                {
                    Environment.Exit(0);
                }
                else
                {
                    InsertIntoDb DbObj = new InsertIntoDb();
                    DbObj.InsertData(XmlStr);
                }

                Console.WriteLine("Done");
                //Console.Read();
        }