예제 #1
0
        static void Main(string[] args)
        {
            Console.WriteLine("Intellio Video Server Frames downloader for timelaps");
            Console.WriteLine("Usage IVSTimelaps.exe [address] [port] [user] [password] [camera] [start time] [end time] [interval(s)]");
            Console.WriteLine();

            if (args.Length < 8)
            {
                Console.WriteLine("Missing parameter(s)");
                Environment.Exit(-1);
            }

            try
            {
                mAddress  = args[0];
                mPort     = int.Parse(args[1]);
                mUser     = args[2];
                mPassword = args[3];
                mCamera   = args[4];

                mStart = ParseDateTimeParam(args[5]);
                mEnd   = ParseDateTimeParam(args[6]);

                mInterval = int.Parse(args[7]);
            }
            catch (Exception e)
            {
                Console.WriteLine("Invalid format: {0}", e.Message);
                Environment.Exit(-1);
            }

            SiteConnector connector;

            connector = new SiteConnector();
            try
            {
                mConnection = connector.Connect(mAddress, mPort, mUser, mPassword);
            }
            catch (Exception e)
            {
                Console.WriteLine("Cannot connect to server ({0}:{1}): {2}", mAddress, mPort, e.Message);
                Environment.Exit(-2);
            }

            mVideoSource = GetVideoSourceByName(mCamera);
            if (mVideoSource == null)
            {
                Console.WriteLine("Camera not found ({0})", mCamera);
                Environment.Exit(-3);
            }

            mOutPath = AppDomain.CurrentDomain.BaseDirectory;

            new Downloader(mConnection, mVideoSource, mStart, mEnd, mInterval, mOutPath);
        }
예제 #2
0
        /// <summary>
        /// Проверка обновлений программы
        /// </summary>
        /// <param name="progVer">Текущая версия основного ПО</param>
        /// <param name="sldVer">Текущая версия библиотек</param>
        private void CheckUpdateProgram(string progVer, string sldVer)
        {
            int ver0, ver1, rev0, rev1;

            string[] vers = progVer.Split('.');

            RequestSettings reqSettings = new RequestSettings();
            reqSettings.Site = "http://it-planets.ru/mbstudio/download_info.php";
            RequestParams reqParams = new RequestParams();
            reqParams.Add("type_info", "ver_po,ver_sld");
            reqSettings.PostData = reqParams.ToString();
            SiteConnector connector = new SiteConnector(reqSettings);

            string newversion_info = string.Empty;
            try
            {
                 connector.DownLoad("GET", Encoding.UTF8);

                if (vers.Count() == 4)
                {
                    if (int.TryParse(vers[0], out ver0))
                    {

                    }
                }
            }
            catch(System.Net.WebException ex)
            {

            }
            catch(Exception ex)
            {

            }
        }