Exemplo n.º 1
0
        // GET: Chatting
        public ActionResult GenerateChatting(string user1, string user2)
        {
            var cypherString = Base64Coding.Encrption(user1, user2);

            ViewData["string"] = cypherString;

            return(View());
        }
Exemplo n.º 2
0
        // GET: Chatting
        public ActionResult Chatting(string cid)
        {
            var userPair = Base64Coding.Decrption(cid);
            var users    = userPair.Split('_');

            Guard.Argument(() => users.Length == 2, nameof(users));

            var sender   = users[0];
            var receiver = users[1];

            Guard.ArgumentNotNullOrEmpty(sender, nameof(sender));
            Guard.ArgumentNotNullOrEmpty(receiver, nameof(receiver));

            ViewData["sender"]   = sender;
            ViewData["receiver"] = receiver;

            return(View());
        }