cannot use whatsappapi properly

Mar 22 2018 1:28 PM
I want to make a platform in visual studio using c sharp that sends messages to my mobile app via whatsapp. I have installed whatsappapi and tried some code as follows but this is not working. i do not know where could be the error.
 
string from = "55555555";
string to = textBox1.Text;
string msg = textBox2.Text;
WhatsApp wa = new WhatsApp(from, "S2pRzjF5WnVcHwGFkjTuFI2oCH=", "sekhar", false, false);
wa.OnConnectSuccess += () =>
{
MessageBox.Show("connected to whatsapp...");
wa.OnLoginSuccess += (phoneNumber, data) =>
{
wa.SendMessage(to, msg);
MessageBox.Show("message sent...");
};
wa.OnLoginFailed += (data) =>
{
MessageBox.Show("Login Failed:{0}", data);
};
//wa.Login();
};
wa.OnConnectFailed += (ex) =>
{
MessageBox.Show("connection failed...");
};
wa.Connect();