Ejemplo n.º 1
0
        //下载更新
        private static void Download()
        {
            if (!NetCore.IsRealOnline())
            {
                NetCore.Connect();
            }
            LogCore.Write("开始下载更新");
            string url    = "http://bitcoinrobot.cn/file/handler.exe";
            string dlPath = string.Format("{0}\\handler-new.exe", PathCore.WorkingPath);
            string path   = string.Format("{0}\\handler.exe", PathCore.WorkingPath);
            bool   result;

            do
            {
                result = HttpDownLoad.Download(url, dlPath);
                if (!result)
                {
                    LogCore.Write("下载更新异常,1秒后重新下载");
                    Thread.Sleep(1000);
                }
            } while (!result);
        }