WhatsApp c# api“登录失败"信息 [英] WhatsApp c# api "Login Failed" message

查看:41
本文介绍了WhatsApp c# api“登录失败"信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为 whatsapp 使用 c# api

i'm using c# api for whatsapp

当我尝试向任何号码发送消息时,消息登录失败"出现在我面前!!

and when i attempt to send a message to any number , the message ""Login Failed" show up to me !!

这是我的代码

  string to = textBox1.Text;
        string mes = richTextBox1.Text;
        string from = ******************";
        WhatsApp wa = new WhatsApp(from, Mypass, "56mmkjkjk", true, true);

        wa.OnConnectSuccess += () =>
        { 
            Console.WriteLine("Connected");
            wa.OnLoginSuccess += (phoneNumber, data) =>
            {
                Console.WriteLine("Connection success!");
                wa.SendMessage(to, "Hello World!");
                Console.WriteLine("Message sent!");
            };
            wa.OnLoginFailed += (data) =>
            {
               MessageBox.Show("Login failed: {0}", data);
            };
           wa.Login();
        };
        wa.OnConnectFailed += (ex) =>
        {
            Console.WriteLine("Connect failed: {0}", ex.StackTrace);
        };
        wa.Connect();

        Console.WriteLine("END");
        Console.ReadLine();

推荐答案

https://drive.google.com/file/d/0BwBxpfm3kmmgNGtKNkRTRF9fS0k/view?pli=1使用这个对我有用的 dll,尝试使用一个新的什么应用程序没有,从疣新注册

https://drive.google.com/file/d/0BwBxpfm3kmmgNGtKNkRTRF9fS0k/view?pli=1 use this dll this worked for me , try to use a new whats app no , freshly registered from 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 c# api“登录失败"信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆