2014-11-03 51 views
-1

如何从C#Asp.net应用程序发送消息(文本,图像,视频)到whatsapp。如何使用C#编程发送消息到whatsapp数字

+1

你跟一个特定的问题或只是一个图书馆一个大礼包挣扎? – 2014-11-03 06:03:41

+0

这将帮助你,WhatsAPINet - https://github.com/perezdidac/WhatsAPINet – 2014-11-03 06:02:57

+0

项目github.com不再存在bro @ andrey.shedko – gumuruh 2016-04-20 15:34:50

回答

2

我找到This Link完美的解决方案。

下面的代码(C#)我用于发送MESSAGE-

//Send (button_click) 
     string from = "9199********"; 
     string to = txtTo.Text;//Sender Mobile 
     string msg = txtMessage.Text; 

     WhatsApp wa = new WhatsApp(from, "BnXk*******B0=", "NickName", true, true); 

     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(); 
+0

whatsapp不提供任何公共api。使用这段代码来做它合法吗? – 2016-06-09 09:16:11

2

通过WhatsApp的编程方式发送大量邮件是明确反对他们的服务条款,并张贴andrey.shedko的(第三方)API的连作者不维护,或接受任何责任。在应用程序中有一个功能,可以根据需要向您实际知道的人发送尽可能多的信息 - 代之以使用它。

内的Legal部分:

(iii) you will not attempt to reverse engineer, alter or modify any part of the Service

C. You agree not to use or launch any automated system, including without limitation, "robots," "spiders," "offline readers," etc. or "load testers" such as wget, apache bench, mswebstress, httpload, blitz, Xcode Automator, Android Monkey, etc., that accesses the Service in a manner that sends more request messages to the WhatsApp servers in a given period of time than a human can reasonably produce in the same period by using a WhatsApp application

他们不提供一个公共的API,因此在这里没有回旋的余地。

相关问题