You must Sign In to post a response.
Category: ASP.NET
#769193
Hi Prakash,
1) To integrate watsapp in dot net application install WhatsAppApi using Tools->NuGet Package Manager->Package Manager Console.
2) After successful installation add below additional namespaces in your application.
using WhatsApp_Application;
using WhatsAppApi;
3)Finally add below code block to send messages on watsapp from application
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...");
};
}
Hope it helps!
Thanks,
Bharati
1) To integrate watsapp in dot net application install WhatsAppApi using Tools->NuGet Package Manager->Package Manager Console.
2) After successful installation add below additional namespaces in your application.
using WhatsApp_Application;
using WhatsAppApi;
3)Finally add below code block to send messages on watsapp from application
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...");
};
}
Hope it helps!
Thanks,
Bharati
#769194
Thanks @Bharati but how we get the WhatsAppPassword. if i use WART i cannot get .
#769196
Hi Praskash,
Could you please provide what kind of error you are getting while generating the password using wart?
Also,please try other tools like
http://wassame.com/tool/create-whatsapp-id/
I am not sure whether it helps.
Thanks,
Bharati
Could you please provide what kind of error you are getting while generating the password using wart?
Also,please try other tools like
http://wassame.com/tool/create-whatsapp-id/
I am not sure whether it helps.
Thanks,
Bharati
Return to Return to Discussion Forum