コード例 #1
0
ファイル: CardController.cs プロジェクト: piriys/SLEOC
        public ActionResult Text(CardTextModel model)
        {
            model.Title = HttpUtility.HtmlDecode(model.Title);
            model.Description = HttpUtility.HtmlDecode(model.Description);
            model.LeftFooter = HttpUtility.HtmlDecode(model.LeftFooter);
            model.RightFooter = HttpUtility.HtmlDecode(model.RightFooter);

            return PartialView(model);
        }
コード例 #2
0
ファイル: SLCardController.cs プロジェクト: piriys/SLEOC
        public ActionResult Text(string encrypted)
        {
            encrypted = Helpers.XOR.Decrypt(encrypted, Helpers.Constants.XORAppKey);
            string scriptURL = HttpUtility.UrlDecode(encrypted);
            CardTextModel model = new CardTextModel();

            try
            {
                using (var client = new WebClient())
                {
                    string json = @client.DownloadString(scriptURL);
                    JObject cardInfo = JObject.Parse(json);
                    string cardType = cardInfo["type"].ToString();
                    if (cardType.ToLower() == "text")
                    {
                        model = cardInfo["parameters"].ToObject<CardTextModel>();
                        return PartialView(model);
                    }
                    else
                    {
                        return RedirectToAction("Error");
                    }
                }
            }
            catch
            {
                return RedirectToAction("Error");
            }
        }