开发者

Error-invalid length for a base-64 char array

开发者 https://www.devze.com 2023-01-01 13:28 出处:网络
I have silverlight app that post some data to another web application ,the data to post is converted to base 64 using code

I have silverlight app that post some data to another web application ,the data to post is converted to base 64 using code

byte[] byteArray = Encoding.UTF8.GetBytes(sDataToPost);
sDataToPost = Convert.ToBase64String(byteArray);
开发者_如何学Go

Another webapplication get the data using the code

strText = System.Text.Encoding.ASCII.GetString(System.Convert.FromBase64String(postedData));

But it gives the exception invalid length for a base-64 char array

Thanks in Advance DNM


Depending on how you post the data its quite possible that the Base64 string is being munged a little more. For example URL encoders may do odd things with the + and = symbols in the Base64 string.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号