Exemplo n.º 1
0
        public static bool DownlaodFile(string downloadFileName)
        {
            string url          = Constants.DOWNLOADSITEURL;
            string downloadPath = "";
            var    ss           = CommonFunctions.GetFromReg(Constants.DOWNLOAD_FOLDER_PATH);

            if (ss != null && ss.Trim().Length > 0)
            {
                downloadPath = ss;
            }
            else
            {
                downloadPath = Application.StartupPath + @"\Downloads\";
            }


            if (!Directory.Exists(downloadPath))
            {
                Directory.CreateDirectory(downloadPath);
            }

            Boolean isFileDownloaded = CommonFunctions.Download(url, downloadFileName, downloadPath);

            if (isFileDownloaded)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }