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.
精彩评论