Answer the question
In order to leave comments, you need to log in
What causes "Invalid length for a Base-64 char array or string" to crash?
In this line crashes
string data = "rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr";
byte[] buffer = Convert.FromBase64String(data);
FormatException: Invalid length for a Base-64 char array or string.
System.Convert.FromBase64_Decode(System.Char* startInputPtr, System.Int32 inputLength, System.Byte* startDestPtr,
Answer the question
In order to leave comments, you need to log in
Because it's garbage, not Base64String. If you are going to test, then first you need to encode the garbage, and only then decode and compare with the original.
And then with the same success, you can save this html page to a file and change the file extension to .exe, and then wonder why the file does not start.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question