protected void Page_Load(HttpContext context) { RetureCode newCode = new RetureCode(); try { Stream sm = context.Request.InputStream; StreamReader inputData = new StreamReader(sm); string DataString = inputData.ReadToEnd(); // Debug.Log("AppleInapp", DataString); ReceiptDataJson _ReceiptDataJson = LitJson.JsonMapper.ToObject <ReceiptDataJson>(DataString); newCode.data.userId = _ReceiptDataJson.UserId; float xx = 0; float.TryParse(_ReceiptDataJson.AppVersion, out xx); string msg = ""; if (PostInApp((int)(xx * 1000) > (int)((3.18f) * 1000), _ReceiptDataJson.UserId, _ReceiptDataJson.receiptData, out newCode.data.sorce, out msg)) { newCode.code = 0; } else { newCode.code = 1; } newCode.msg = msg; } catch (Exception exp) { newCode.code = 2; newCode.msg = exp.Message.ToString() + "\n" + exp.StackTrace.ToString(); Debug.LogException(exp); } WebApplication1.Phone.SendStringToClient(httpContext, LitJson.JsonMapper.ToJson(newCode)); }
protected void Page_Load(object sender, EventArgs e) { Stream sm = Request.GetBufferedInputStream(); StreamReader inputData = new StreamReader(sm); string DataString = inputData.ReadToEnd(); Debug.Log("AppleInapp", DataString); ReceiptDataJson _ReceiptDataJson = LitJson.JsonMapper.ToObject <ReceiptDataJson>(DataString); RetureCode newCode = new RetureCode(); newCode.data.userId = _ReceiptDataJson.UserId; if (PostInApp(_ReceiptDataJson.UserId, _ReceiptDataJson.receiptData, out newCode.data.sorce)) { Debug.Log("AppleInapp", "", true); newCode.code = 0; } else { Debug.Log("AppleInapp", "", false); newCode.code = 1; } WebApplication.PhoneLogin.SendStringToClient(this, LitJson.JsonMapper.ToJson(newCode)); }