whatsapp c# Auth 响应错误

编程入门 行业动态 更新时间:2024-10-18 10:36:15
本文介绍了whatsapp c# Auth 响应错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我正在为 whatsapp 使用最新的 nuget 版本:WhastApp API 1.2.2 并阅读有关在我的应用程序中配置我的 whatsapp 的教程.我正在使用我的本地主机进行测试,我的代码是:

I'm using the last nuget version for whatsapp: WhastApp API 1.2.2 and reading tutorials about configure my whatsapp in my application. I'm using my localhost to test and my code is:

string from = "503XXXX";
            string to = "503XXXX";
            string msg = "lorem ipsum";

            WhatsApp wa = new WhatsApp(from, "jd8eY3FXXXXXXXXXXXXXXXXXXX", "MrMins", true);

            wa.OnConnectSuccess += () =>
                                       {
                                           wa.OnLoginSuccess += (phoneNumber, data) =>
                                                                    {
                                                                        wa.SendMessage(to, msg);
                                                                    };
                                       };

            wa.OnLoginFailed += (data) =>
            {
                //Fail message
            };

            wa.Login();

            wa.OnConnectFailed += (ex) =>
            {
                //ConnectionFailed
            };

            wa.Connect();
            wa.SendMessage(to, msg);
            wa.Disconnect();

我收到错误:

Auth response error 

我使用 WART 更新了我的 whatsapp 密码,并从我的 whatsapp 手机中注销(我认为是正确的行为),但仍然无法正常工作.

I updated my whatsapp password with WART and logged me out from my whatsapp mobile (I think is the correct behavior), but is still not working.

我的代码有什么问题?

推荐答案

想象一下,你的代码区是:503,你的电话号码是555555555555

Imagine, your code area is: 503 and your phone number is 555555555555

WhatsApp wa = new WhatsApp("503555555555555", "get the password using WART", "your nickname", false, false);
            wa.OnConnectSuccess += () =>
            {
                Response.Write("connect");
                wa.OnLoginSuccess += (phno,data) =>
                {
                    wa.SendMessage("Destinatino number (50377777777777)", "Youre custom message");
                };

                wa.OnLoginFailed += (data) =>
                {
                    Response.Write("login failed"+data);
                };
                wa.Login();
            };
            wa.OnConnectFailed += (ex) =>
                                      {
                                          Response.Write("connection failed");
                                      }
                ;

            wa.Connect();

这篇关于whatsapp c# Auth 响应错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-26 03:53:31,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1128665.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:错误   whatsapp   Auth

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!