Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
protected void btnsend_Click(object sender, EventArgs e)
{
try
{
string from = "91******76";
string to = txtTo.Text;
string msg = txtMessage.Text;

WhatsApp wa = new WhatsApp(from,"Ka*************8Pc8=","Parish", true, true);

wa.OnConnectSuccess += () =>
{
wa.OnLoginSuccess += (phoneNumber, data) =>
{
lblAlert.Text += "Connected to whatsapp...";
wa.SendMessage(to, msg);
lblAlert.Text += ("Message Sent !").ToString();
};

wa.OnLoginFailed += (data) =>
{
lblAlert.Text += ("Login Failed, " + data + " ").ToString();
};
wa.Login();
};

wa.OnConnectFailed += (ex) =>
{
lblAlert.Text += ("Connection Failed...").ToString();
};
wa.Connect();
}
catch (Exception ex) { }
}
Posted
Updated 18-Oct-15 21:00pm
v2
Comments
sreeyush sudhakaran 19-Oct-15 3:28am    
I hope this API you got from GitHub non offical API ,unfortunately if so this is not working API , Please mention name of API Lib you used
Richard MacCutchan 19-Oct-15 6:48am    
The error message tells you everything you need to know.
ZurdoDev 19-Oct-15 8:40am    
What is your question? The error is quite clear.

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