Click here to Skip to main content
15,886,780 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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"
C#
public static string Base64DecodingMethod(string sData)
   {

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

   }
Posted
Updated 12-Jul-12 0:09am
v2

1 solution

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
 
Share this answer
 
Comments
Pratham4950 14-Jul-12 1:43am    
I try encode and decode with query string.
it's successful run on local host. but when I have upload project on server.
that time not receive value on decode page with query string.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900