コード例 #1
0
        private void EncodeTest(ParamRequest urlPath)
        {
            byte[] toEncodeAsBytes = System.Text.ASCIIEncoding.ASCII.GetBytes(urlPath.UrlPath);
            string returnValue     = System.Convert.ToBase64String(toEncodeAsBytes);

            Console.WriteLine(returnValue);
            Console.WriteLine("---------------------------");
        }
コード例 #2
0
        public string CutUrl([FromBody] ParamRequest urlPath)
        {
            EncodeTest(urlPath);

            var link = new ShortLink()
            {
                Url = urlPath.UrlPath,
                Id  = urlPath.Id
            };

            var urlChunk = link.GetUrlChunk();

            return(urlChunk);
            // return urlPath;
        }