且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

编码和解码错误

更新时间:2023-02-23 11:56:43

我将尝试两件事...按顺序

1.查看您要解码的字符串,看看是否有明显的痕迹
2. ^ ]并从第一个响应开始,似乎很详尽

Hi,

i have using encoding and decoding.
in my code encoding is successful running but when we redirect for decoding that time one error is occurred.
error is :- "Invalid character in a Base-64 string"

public static string Base64DecodingMethod(string sData)
   {

       byte[] encData = System.Convert.FromBase64String(sData);
       string result = System.Text.ASCIIEncoding.ASCII.GetString(encData);
       return result;

   }

I''d try two things ... in order

1. Look at the string you''re trying to decode, and see if anything obvious sticks out
2. Google the error message[^] and start at the first response, it seems quite exhaustive