venomous0x / WhatsAPI

Interface to WhatsApp Messenger
2.59k stars 2.13k forks source link

Using C# web application , I make a program but until now when i running my system and open my whatsapp application, there is no message .. Plz help ! #1164

Open ghost opened 9 years ago

mgp25 commented 9 years ago

https://github.com/mgp25/Chat-API-NET

ghost commented 9 years ago

what i supposed to do with that sir ? This is my code sir . can you help me sir ?

protected void btnSend_Click(object sender, EventArgs e) { string from = "+639061714515"; string to = txtTo.Text; string msg = txtMessage.Text;

        WhatsApp wa = new WhatsApp(from, "EXWzzq2kmx6OTM10IBULrZ57/xg=", "Ej", false, false);

        wa.OnConnectSuccess += () =>
        {
            MessageBox("Connected to whatsapp...");

            wa.OnLoginSuccess += (phoneNumber, data) =>
            {
                wa.SendMessage(to, msg);
                MessageBox("Message Sent...");
            };
            wa.OnLoginFailed += (data) =>
            {
                MessageBox("Login Failed:");
            };
            wa.Login();

        };
        wa.OnConnectFailed += (ex) =>
        {
            MessageBox("Connection Failed...");
        };
        wa.Connect();
    }
    public void MessageBox(string MessageBox) {
        Page.ClientScript.RegisterStartupScript(Page.GetType(), "Message Box", "<script language='javascript'>alert('" + MessageBox + "')</script>");
    }
}

}