public string UpdateAppVersion(HttpContext context) { string statu = "{\"status\":0}"; bool flg = false; int type = 0; bool force = false; int size = 0; int appid = 0; try { BCtrl_Common bll = new BCtrl_Common(); AppUpdateEntity entity = new AppUpdateEntity(); int.TryParse(context.Request.Form["apptype"].ToString(), out type); entity.AppType = type; entity.Version = context.Request.Form["version"]; entity.UpdateProfile = HttpUtility.UrlDecode(context.Request.Form["profile"], Encoding.UTF8); entity.DownloadUrl = HttpUtility.UrlDecode(context.Request.Form["downurl"], Encoding.UTF8); bool.TryParse(context.Request.Form["forcedupdate"] == "1" ? "true" : "false", out force); entity.ForcedUpdate = force; int.TryParse(context.Request.Form["size"], out size); int.TryParse(context.Request.Form["appid"], out appid); entity.AppId = appid; entity.AppSize = size; flg = bll.UpdateAppVersion(entity); if (flg) { statu = "{\"status\":1}"; } else { statu = "{\"status\":2}"; //修改失败 } } catch (Exception e) { LogUtil.WriteLog(e); statu = "{\"status\":0}"; //数据传输错误 } return(statu); }