Exemple #1
0
 public IActionResult UrlEncode(UrlEncodeViewModel model)
 {
     try
     {
         if (model.Decrypt)
         {
             model.ResultString = WebUtility.UrlDecode(model.SourceString);
         }
         else
         {
             model.ResultString = WebUtility.UrlEncode(model.SourceString);
         }
     }
     catch (Exception e)
     {
         model.ResultString = $"Invalid input! Error message: \r\n{e.Message} \r\n {e.StackTrace}";
     }
     return(View(model));
 }
Exemple #2
0
        public IActionResult UrlEncode()
        {
            var model = new UrlEncodeViewModel();

            return(View(model));
        }