我想用whatsapi发送消息,这是我的尝试
string nickname = "Test";
string sender = "xxxxxxxxxxxxxx";
//My Phone Number tryed with 049xxxxxxxxxxxx, 0049xxxxxxxxxxxxxx, 49xxxxxxxxxxxxxxx, xxxxxxxxxxxxxx
string imei = "xxxxxxxxxxxxxxxxxxxxxxxxx";//My IMEI
WhatsApp me = new WhatsApp(sender,imei ,nickname,true);
me.Connect();
Console.WriteLine(me.ConnectionStatus);// I get a Connection!
Console.ReadLine();
me.SendMessage("xxxxxxxxxx", "This is a Test!");// Send Message
//No Message received :(
me.Disconnect();
Console.WriteLine(me.ConnectionStatus);
Console.ReadLine();现在,我的错误在哪里?以及我是怎么做对的?
我正在使用这个版本: https://github.com/perezdidac/WhatsAPINet。
首先,我只想发送消息。当我尝试从瘤中获取请求时,我只得到了这样的消息:
Could not request code using either sms or voice.
SMS: {"status":"fail","reason":"no routes","retry_after": 3600}
Voice: {"status":"fail","reason":"no routes","retry_after": 3600}发布于 2015-07-14 00:19:14
WhatsApp wa = new WhatsApp("your number", "your password", "pankaj", false, false);
wa.OnConnectSuccess += () =>
{
Response.Write("connect");
wa.OnLoginSuccess += (phno,data) =>
{
wa.SendMessage("to", "msg");
};
wa.OnLoginFailed += (data) =>
{
Response.Write("login failed"+data);
};
wa.Login();
};
wa.OnConnectFailed+= (ex)=>
{
Response.Write("connection failed");
}发布于 2015-07-12 15:05:11
从此链接下载generate password https://github.com/mgp25/WART的安装程序
然后传递你的手机号和你得到的密码。并在whatsapp对象的构造函数中传递用户详细信息,如他的no或msg。
它将为您工作。试一试。
发布于 2015-03-12 05:43:57
在连接之后,将命令放入Login。我是这样解决的:
me.connect();
me.login(null);https://stackoverflow.com/questions/27745722
复制相似问题