Click here to Skip to main content
15,884,836 members
Please Sign up or sign in to vote.
1.40/5 (2 votes)
See more:
I am getting the error "Invalid length for a Base-64 char array or string".

Please find code below:

C#
WhatsApp wz = new WhatsApp(s, "dskgjhgkjgkjgg=", "RTS", false, false);
wz.OnConnectSuccess += () =>
{
     MessageBox.Show("conected to whatsup");
     wz.OnLoginSuccess += (phonenNumber, data) =>
     {
           wz.SendMessage(to, msg);
           MessageBox.Show("mesageSent");
     };
                    
     wz.OnLoginFailed += (data) =>
     {
           // wz.SendMessage(to, msg);
           MessageBox.Show("Login Failed :{0}",data);
     };
              
     wz.Login();
     // error is here(Invalid length for a Base-64 char array or string)
                };
Posted
Updated 23-Sep-15 5:00am
v3
Comments
Richard Deeming 23-Sep-15 10:51am    
Probably caused by the string you're passing to the constructor - "dskgjhgkjgkjgg=" - which looks like an invalid Base-64 string.

However, since you haven't told us which API you're using, there's no way to know what that parameter is supposed to be.
rahuls1 23-Sep-15 11:11am    
can you tell in detail..?
private void button1_Click(object sender, EventArgs e)
{
rahuls1 23-Sep-15 11:12am    
it is password.
[no name] 24-Sep-15 0:39am    
Check in which format your class initialization needs the password to be passed as parameter in WhatsApp().

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