Advertisement
Guest User

Untitled

a guest
Jul 29th, 2015
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. //Send ( button_click )
  2. string from = "9199********";
  3. string to = txtTo.Text;//Sender Mobile
  4. string msg = txtMessage.Text;
  5.  
  6. WhatsApp wa = new WhatsApp(from, "BnXk*******B0=", "NickName", true, true);
  7.  
  8. wa.OnConnectSuccess += () =>
  9. {
  10. MessageBox.Show("Connected to whatsapp...");
  11.  
  12. wa.OnLoginSuccess += (phoneNumber, data) =>
  13. {
  14. wa.SendMessage(to, msg);
  15. MessageBox.Show("Message Sent...");
  16. };
  17.  
  18. wa.OnLoginFailed += (data) =>
  19. {
  20. MessageBox.Show("Login Failed : {0}", data);
  21. };
  22.  
  23. wa.Login();
  24. };
  25.  
  26. wa.OnConnectFailed += (ex) =>
  27. {
  28. MessageBox.Show("Connection Failed...");
  29. };
  30.  
  31. wa.Connect();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement