You can use whatsapp api by copying api files to your project and code “using” in your .cs file
Sending WhatsApp Message Through .NET Application by Using C# Coding
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...");
};
}
}
}
I checked this code on the
https://nz-casinos.com/jackpot-city-casino-review/ website last year. At me, everything turned out. If messages are not sent, address programmers.
Raja_89, if this helps please login to Mark As Answer. | Alert Moderator