当前位置: 首页 > 编程语言 > C#

使用whatsapi.net发送消息?分享

时间:2023-04-11 03:41:53 C#

用whatsapi.net发消息?我想用whatsapi发送消息,这是我的尝试IMEIWhatsAppme=newWhatsApp(sender,imei,nickname,true);我.Connect();Console.WriteLine(me.ConnectionStatus);//我得到一个连接!控制台.ReadLine();me.SendMessage("xxxxxxxxxx","ThisisaTest!");//发送消息//没有收到消息:(me.Disconnect();Console.WriteLine(me.ConnectionStatus);Console.ReadLine();现在我的错误在哪里?我该怎么做?我正在使用这个版本:https://github.com/perezdidac/WhatsAPINet。首先,我只想发送一条消息。当我尝试从WART获取请求时,我收到此消息:无法使用短信或语音请求代码。短信:{"status":"fail","re??ason":"noroutes","re??try_after":3600}语音:{"status":"fail","re??ason":"noroutes","retry_after":3600}WhatsAppwa=newWhatsApp("你的号码","你的密码","pankaj",false,false);wa.OnConnectSuccess+=()=>{Response.Write("connect");wa.OnLoginSuccess+=(phno,data)=>{wa.SendMessage("to","msg");};wa.OnLoginFailed+=(data)=>{Response.Write("登录失败"+data);};wa.Login();};wa.OnConnectFailed+=(ex)=>{响应。Write("连接失败");从这个链接https://github.com/mgp25/WART下载生成密码的安装程序后,传递您的手机号码和密码。并在whatsapp对象的构造函数中传递用户详细信息,如他的no或msg。它会为你工作。尝试一下。连接后向登录发送命令。我是这样解决的:以上是C#学习教程:使用whatsapi.net发送消息?如果分享的内容对你有用,需要了解更多C#学习教程,希望你多多关注——me.connect();我.login(null);本文收集自网络,不代表立场。如涉及侵权,请点击右侧联系管理员删除。如需转载请注明出处: