Exemplo n.º 1
0
        public ActionResult Download(string target = null)
        {
            var userAgent = Request.UserAgent.ToLower();

            if (target == "ios" || userAgent.Contains("iphone") || userAgent.Contains("mac os x"))
            {
                var downloadUrl = AppEnvironment.GetValueFromConfig("appstore:ios", "/");
                return(Redirect(downloadUrl));
            }
            else if (Request.UserAgent.ToLower().Contains("micromessenger") || target == "wechat")
            {
                var appVersion  = GetLastVersionByAndroid();
                var downloadUrl = string.Format("http://a.app.qq.com/o/simple.jsp?pkgname={0}", appVersion.PackageName);
                return(Redirect(downloadUrl));
            }
            else
            {
                var file = PackageHelper.GetAndroidPackageFile();
                PackageHelper.DownloadFile(PackageHelper.GetAndroidPackageFile(), this.Response);
                return(null);
            }
        }