Sending WhatsApp Message Through .NET Application by Using C# Coding


Previous Project with Source Code :

  1. Stock Management System Project With Source Code
  2. Library Management System Project With Source Code
  3. School Management System Project With Source Code

In this article i'm going to show you "How to Send WhatsApp Message by Using C# Coding", first design Windows Form as shown in above image. Before writing code to send whatsapp message first we need to Install WhatsApp API in our application, based on this WhatsApp API we can create object for WhatsApp. By using WhatsApp Object we can call WhatsApp Methods.
WhatsApp Methods : OnConnectSuccess, OnLoginSuccess , OnLoginFailed, OnConnectFailed


Sending Whatsapp message using C# coding

To Download WhatsApp API Follow this Image's to Install


Step : 1 - To Install WhatsApp API Image View and download
Step : 2 - To Install WhatsApp API Image View and  download
Step : 3 - To Install WhatsApp API Image View and  download
Step : 4 - To Install WhatsApp API Image View and  download
Step : 5 - Finish

You can Download WhatsApp Registration Tools from below link :

Download Project

To Get WhatsApp Password From WhatsApp Registration Tools

Step : 1 - To get WhatsApp Password Image View and  download
Step : 2 - To get WhatsApp Password Image View and  download
Step : 3 - To get WhatsApp Password Image View and  download
Step : 4 - To get WhatsApp Password Image View and  download

C# Coding

C# Coding : Namespace


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using WhatsApp_Application;
using WhatsAppApi;

C# Coding : To Send WhatsApp Message


namespace WhatsApp_Application
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void btn_send_Click(object sender, EventArgs e)
        {
            string from = "9199876543210"; //(Enter Your Mobile Number)
            string to = txt_to.Text;
            string msg = txt_msg.Text;
            WhatsApp wa = new WhatsApp(from, "WhatsAppPassword", "NickName", false, false);
            wa.OnConnectSuccess += () =>
            {
                MessageBox.Show("Connected to WhatsApp...");
                wa.OnLoginSuccess += (phonenumber, data) =>
                    {
                        wa.SendMessage(to, msg);
                        MessageBox.Show("Message Sent...");
                    };
                wa.OnLoginFailed += (data) =>
                    {
                        MessageBox.Show("Login Failed : {0} : ", data);
                    };

                wa.Login();
            };
            wa.OnConnectFailed += (Exception) =>
                {
                    MessageBox.Show("Connection Failed...");
                };           
        }
    }
}

VIDEO : Sending WhatsApp Message Using C# Code

Tag : C#, WhatsApp
9 Komentar untuk "Sending WhatsApp Message Through .NET Application by Using C# Coding"

you can download from here
https://github.com/mgp25/WART

Great article... but... I think you forgot "wa.Connect();" at the end of code;

Hi Sekhar. Great Post.but while run its showing Status As Connected but LoginStatus as Null so its not executing message send code. can you help me over this.

What is create what's app password to use this app please reply me in aashishtyagig@gmail.Com please help me

But sir how to create WhatsApp password please reply me soon

To Download PasswordToolsGenerator
https://github.com/mgp25/WART

Hi the password generator keeps giving me:
Could not request code using either sms or voice.
SMS: status: fail, rason: bad token
Voice: status: fail, reason: bad token.

I am from south africa and tried this on two devices with different sim cards in and definitely gave the right number with area code. Please can you assist.

I am getting this error when attempting to request for code: Provided number does not match any known patterns for

New comments are not allowed.
Back To Top