WhatsApp c#WhatsAPINet-登录失败:未授权

WhatsApp c#WhatsAPINet-登录失败:未授权,c#,.net,whatsapp,C#,.net,Whatsapp,感谢,我已经成功地编写了连接WhatsApp和发送简单消息的正确代码 using System; using WhatsAppApi; using WhatsAppApi.Register; namespace WhatsAppBot { class Program { static void Main(string[] args) { WhatsApp wa = new WhatsApp("********", "***

感谢,我已经成功地编写了连接WhatsApp和发送简单消息的正确代码

using System;
using WhatsAppApi;
using WhatsAppApi.Register;

namespace WhatsAppBot
{
    class Program
    {
        static void Main(string[] args)
        {
            WhatsApp wa = new WhatsApp("********", "********", "sakher", false, false);
            // I tried with phone numbers like "38xxxxxxx", "+38xxxxxxx". 
            // The phone number wasn't previously registered in WhatsApp.
            // Password was generated using WART. 
            wa.OnConnectSuccess += () =>
            {
                Console.WriteLine("Connected");
                wa.OnLoginSuccess += (phoneNumber, data) =>
                {
                    Console.WriteLine("Connection success!");
                    wa.SendMessage("********", "Hello World!");
                    // Number is correct and registered in WhatsApp
                    Console.WriteLine("Message sent!");
                };

                wa.OnLoginFailed += data => {
                    Console.WriteLine("Login failed: {0}", data);
                    // Login failed: not-authorized 
                };
                wa.Login();
            };
            wa.OnConnectFailed += (ex) =>
            {
                Console.WriteLine("Connect failed: {0}", ex.StackTrace);
            };
            wa.Connect();
            wa.Disconnect();
            Console.WriteLine("BYE");
        }
    }
}
我已经为同一个号码在WART中生成了好几次密码,但都没有成功

一个应用程序简单地说:登录失败:未授权

也许有人知道如何解决这个问题?

使用这个dll这对我来说很有效,尝试使用一个新的whats应用程序no,刚从wart注册

使用的代码是

      WhatsApp wa = new WhatsApp(sender, password, nickname, true, true);
      wa.OnConnectSuccess += () => {
        Console.WriteLine("Connected");
        wa.OnLoginSuccess += (phoneNumber, data) => {
            Console.WriteLine("Connection success!");
            wa.SendMessage(target, "testing C# Api,sent via C#");
            Console.WriteLine("Message sent!");
        };
        wa.OnLoginFailed += (data) => {
            Console.WriteLine("Login failed: {0}", data);
        };
        wa.Login();
      };
      wa.OnConnectFailed += (ex) => {
        Console.WriteLine("Connect failed: {0}", ex.StackTrace);
      };
      wa.Connect();
      Console.WriteLine("END");

我也遇到了同样的问题。这几乎肯定是因为whatsapp改变了他们的身份验证并打破了传统,因为他们不仅不支持公共API,他们明确地试图阻止人们在没有应用程序的情况下使用他们的服务。它正在工作,但在运行并重新启动程序几次后,我登录失败:未授权!那么如何解决这个问题呢?有时间重新连接吗?
private void button1_Click(object sender, EventArgs e)
{
     //Send To details
     string Phnumber = textBox1.Text;
     string message = textBox2.Text;

     //send From details

     string FromNumber = "917673943979";
     string password = "aaRvxtEbePyI/uBOqpqw9yeHlys=";
     string nickName = "Dayakar";

     WhatsApp wap = new WhatsApp(FromNumber, password, nickName, false, false);
     wap.OnConnectSuccess += () =>
         {
             MessageBox.Show("Connected to whatsapp SuccessFully...");

             wap.OnLoginSuccess += (PhoneNumber, data) =>
             {
                 MessageBox.Show("Enterned");
                 wap.SendMessage(Phnumber, message);
                 MessageBox.Show("Message Sent Successfully...");
             };

             wap.OnLoginFailed += (data) =>
             {
                 MessageBox.Show(data);
                 MessageBox.Show("Yes Failed login : {0}", data);
             };

             wap.Login();
         };

     wap.OnConnectFailed += (ex) =>
         {
             MessageBox.Show("Conncetion Failure");
         };

     wap.Connect();
 }