venomous0x / WhatsAPI

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

WhatsApp C# SourceCode #120

Closed whatsUser closed 10 years ago

whatsUser commented 11 years ago

Hi,

as im not in the motivation of programming on whatsapp currently, ill share my project with the community. Hope someone will make a usable App out of it, as the backend is already working.

Anyone can change code or copy code from it or do what ever he wants, as im not the founder of the idea "whatsapp" and its implementation and so want no credits.

http://www21.zippyshare.com/v/23668176/file.html

Have fun and please contribute your success with the world

arkanoz commented 9 years ago

pleas I'am want send get photo profile to whatsapp .net

arkanoz commented 9 years ago

pleas I'am want send get photo profile to whatsapp .net

fahmawi commented 9 years ago

Dirs,,, Any one knows how to check if receiver number exists and if he receiver the message ????

arkanoz commented 9 years ago

how? fahmawi

I'am knows how check ,but at get photo not rescive

the result is "get_photo_0"

mgp25 commented 9 years ago

This repo is only PHP not c#. We are giving support in https://girhub.com/mgp25/WhatsAPI-Official (php)

We have a wiki with full documentation there.

Regards.

ryadhh commented 9 years ago

Hi @shirioko please how can i send image ??? every time i try i have error ?

ithinkunome commented 9 years ago

I used wart to generate the passowrd, but when I try to login with that password it says login failed. I tried to input my mobile number is differnet format but it didn't work. please help

Thanks

ackid32 commented 9 years ago

Hi I struck with Login Failed - not authorised. Any help.

Here is my code (in VB)

        Dim originalText = "91999xxxxxx1"
        Dim binaryData = Encoding.ASCII.GetBytes(originalText)
        Dim base64String = Convert.ToBase64String(binaryData)

        Dim originalText1 = "123456789444751"
        Dim binaryData1 = Encoding.ASCII.GetBytes(originalText1)
        Dim base64String1 = Convert.ToBase64String(binaryData1)

        Dim originalText3 = "kPhone"
        Dim nickname As String = originalText3
        Dim lsender As String = base64String
        Dim password As String = base64String1

        Dim wa As New WhatsApp(lsender, password, nickname, True)
        AddHandler wa.OnLoginFailed, AddressOf wa_OnLoginFailed
        wa.Connect()
        wa.Login() ' here i got  the error

What is the mistake i commit?

ngonlinh commented 9 years ago

I have a website http://yeudongho.net/, i want when user booking after it will send to sms to Viber or Skype. How do you do it?

kailash74 commented 9 years ago

SENT: SENT: <media hash="35y7k4ay8wpdiSWt+P4ruv7SkLT+dPwKZhc0jkM1sSY=" type="image" size="1472"> SENT: System.Exception: MAC mismatch on index 0! 12 != 214 at WhatsAppApi.Helper.KeyStream.DecodeMessage(Byte[] buffer, Int32 macOffset, Int32 offset, Int32 length)

unable to sent images

erarijit commented 9 years ago

Hi, Is the thread is still active?

hpatel4u commented 9 years ago

no you can visit --> https://github.com/hpatel4u/Chat-API-NET

mohammad3n commented 9 years ago

@hpatel4u This code works fine. But I cant receive messages and when I send a message It does not give the delivery. Is there a way to fix these?

amanssit commented 9 years ago

hi friends i want to get whatsapp password ,can any one help , i try with wart but its showing old version

hpatel4u commented 9 years ago

@mohammad3n hope you register the OnGetMessage, OnDeliverByClient, OnDeliverByServer event before login. Try console test application provided by @mgp25, its working fine.

@amanssit have you try with https://github.com/mgp25/WART

mohammad3n commented 9 years ago

@hpatel4u Thanks a lot. By the way the name of OnDeliveryByClient is changed to OnGetMessageReceivedClient and OnDeliveryByServer is changed to OnGetMessageReceivedServer.

hpatel4u commented 9 years ago

@mohammad3n Yes correct it was my mistake.

Did you get the result? On Jun 6, 2015 4:38 PM, "mohammad3n" notifications@github.com wrote:

@hpatel4u https://github.com/hpatel4u Thanks a lot. By the way the name of OnDeliveryByClient is changed to OnGetMessageReceivedClient and OnDeliveryByServer is changed to OnGetMessageReceivedServer.

— Reply to this email directly or view it on GitHub https://github.com/venomous0x/WhatsAPI/issues/120#issuecomment-109565125 .

amanssit commented 9 years ago

can any one reply me , how to get whatsapp password

On Sat, Jun 6, 2015 at 4:38 PM, mohammad3n notifications@github.com wrote:

@hpatel4u https://github.com/hpatel4u Thanks a lot. By the way the name of OnDeliveryByClient is changed to OnGetMessageReceivedClient and OnDeliveryByServer is changed to OnGetMessageReceivedServer.

— Reply to this email directly or view it on GitHub https://github.com/venomous0x/WhatsAPI/issues/120#issuecomment-109565125 .

mohammad3n commented 9 years ago

@hpatel4u Yes. The sample that you mentioned is working fine.

@amanssit Download the source code from this link. https://github.com/hpatel4u/Chat-API-NET. Open it in visual studio. Set the Windows Forms project as startup project. Run the application. In the first form click the Register button and follow the process.

mohammad3n commented 9 years ago

@hpatel4u Do you know how to create a group and send a message to a group?

pareta2 commented 9 years ago

Is this code still works??? After takeover of facebook on whatsapp??

On Sun, Jun 7, 2015 at 1:29 PM, mohammad3n notifications@github.com wrote:

@hpatel4u https://github.com/hpatel4u Do you know how to create a group and send a message to a group?

— Reply to this email directly or view it on GitHub https://github.com/venomous0x/WhatsAPI/issues/120#issuecomment-109715276 .

Shubham Pareta (INDIA)

mohammad3n commented 9 years ago

Yes. It works for me.

pareta2 commented 9 years ago

I tried the same code when facebook just bought whatsapp. It was not allowing me to login after that i did not tried. Now i will try once again.

On Mon, Jun 8, 2015 at 1:56 PM, mohammad3n notifications@github.com wrote:

Yes. It works for me.

— Reply to this email directly or view it on GitHub https://github.com/venomous0x/WhatsAPI/issues/120#issuecomment-109905377 .

Shubham Pareta (INDIA)

erarijit commented 9 years ago

@hpatel4u & @mohammad3n

Can we see the msgs received in the chat window itself or in debug mode or save them in xml something?

hpatel4u commented 9 years ago

@erarijit you can use OnGetMessage() Event, whatever message received on your logged in number will received on it. you can write it in chat window or save it in xml or in text file..

:+1:

greycells2008 commented 9 years ago

Hi, I am trying to read whatsapp messages using whatsapp API for .net. I have used pollMessages() and then trying to count the messages received, but I am not getting any messages. The whatsapp app from which I am sending the messages is showing the messages as delivered, but I can't seem to catch them in my application. Please tell me where I am going wrong. Here is my code:

        WhatsApp msg = new WhatsApp(number, password, nick);
        msg.OnConnectSuccess += () =>
        {

            msg.OnLoginSuccess += (phoneNumber, data) =>
            {
                Console.WriteLine("Connection success!");                                    
            };
            msg.OnLoginFailed += (data) =>
            {
                Console.WriteLine("Login failed: {0}", data);
            };
            msg.Login();
        };
        msg.OnConnectFailed += (ex) =>
        {
            Console.WriteLine("Connect failed: {0}", ex.StackTrace);
            Console.WriteLine("Error: ", ex.Message);
        };
        msg.Connect();
        Console.WriteLine(msg.ConnectionStatus.ToString());
        for (int i = 0; i < 5; i++)
        {
            msg.PollMessages();
        }
        var hasmsg = msg.GetAllMessages();
        Console.WriteLine("Number of messages: " + hasmsg.Count());
        msg.Disconnect();
        Console.WriteLine("END");
        Console.ReadLine();
hpatel4u commented 9 years ago

Hi,

Register wa.OnGetMessage += wa_OnGetMessage; event and try below method.

static void wa_OnGetMessage(ProtocolTreeNode node, string from, string id, string name, string message, bool receipt_sent) { Console.WriteLine("Message from {0} {1}: {2}", name, from, message); }

greycells2008 commented 9 years ago

Thanks a ton, it worked like a charm :) I knew I was missing something important!

Chitrakant-Sahu commented 9 years ago

Please anyone give me valid link for downloading WhatsApp Api because above given link doesn't work when i click on link then page not found error shown please give me valid link

mgp25 commented 9 years ago

@Chitrakant-Sahu https://github.com/WHAnonymous/Chat-API

Chitrakant-Sahu commented 9 years ago

I want to implement WhatsApp with .net c# so please give me a valid WhatsApp Api download link. It's urgent.

ghost commented 9 years ago

Hi Can you pls help me with my problem , i can't receive message from my application but its running . this is my code . This is so very important to me .. plssss help me .

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>");
    }
}

}

Mystpot commented 9 years ago

I understand that no-one is really tracking this version of the API anymore as the PHP one is far more documented, however, I am relatively new to programming and I'd like to be able to use the .net version for a Windows Form. I see thats WhatsAppPort isn't fully completed, as I can send a message to a number but I cannot receive one. Is it better to work on the WhatsAppPort further, or should I try my hand at converting the WhatsTest console code to a Windows Form application?

WHAnonymous commented 9 years ago

@Mystpot use this https://github.com/mgp25/Chat-API-NET

ppiyushjv commented 9 years ago

Hi, I am facing a problem when sending an image. I try to convert image to byte

  1. byte[] img = File.ReadAllBytes("d:\1.jpg");
  2. byte[] imageBytes = null; using (MemoryStream ms = new MemoryStream()) { using (Bitmap b = new Bitmap("d:\1.jpg")) { b.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg); } imageBytes = ms.ToArray(); }

so please tell me how to send image by message

nasiraftab commented 9 years ago

Hi , I am looking for whatsApp Sender Working Exe / Source . Anyone have this and can let me know wow to get this ? aftarizw1@gmail.com

thanks . .

munavvarhusein commented 8 years ago

unable to sent images

MAC mismatch on index 0! 224 != 9

Please Help.

singhvibhuti commented 8 years ago

How to send group message from c# api, i am able to send text, imaga, video, vCard to individual no.

but i want to create group it is not working..

Any idea what i missed, i just called method SendGrouoChat and passed subject

kailash74 commented 8 years ago

hi vibhuti would really appreciate if u can share the code as sending images and video was an issue for me On Oct 27, 2015 10:13 PM, "Vibhuti Singh" notifications@github.com wrote:

How to send group message from c# api, i am able to send text, imaga, video, vCard to individual no.

but i want to create group it is not working..

Any idea what i missed, i just called method SendGrouoChat and passed subject

— Reply to this email directly or view it on GitHub https://github.com/venomous0x/WhatsAPI/issues/120#issuecomment-151563591 .

cexarmonroy commented 8 years ago

Help with sending images please

singhvibhuti commented 8 years ago

Issue is with recipients, try to convert it in jid format..

numbar@s.whatsapp.net it will work.

If u face any other issue let me know..

Also reply if it work

singhvibhuti commented 8 years ago

plz help to create group, i am able to send message to group by getting group id. But when we create group pragmatically it is not returning group id.

erarijit commented 8 years ago

@singhvibhuti

Can you please share the code for i am able to send text, imaga, video, vCard to individual no.

singhvibhuti commented 8 years ago

I am also able to send text, image, audio, video n vCard to individual as well as group.

Issue is with creating group pragmatically

erarijit commented 8 years ago

Can you share your code?

justplaystudios commented 8 years ago

Hello, I work with C#, Visual Studios and Xamarin Can anybody tell me how I can connect to whatsapp I don't realy need the API, because i want my aplication to be similar with web.whatsapp, Do not need to create a new account, i want to connect to the existing account What I need is when i receive any message on whatsapp, to be forworded to my app, an i what to be able to rebly from my app. All of this need the Original Whatsapp to be installed (to depend of it)

Thank you

karaledhiraj commented 8 years ago

hi, I want to see what's app profile picture of existent contact in c#

bastianonm commented 8 years ago

@karaledhiraj me too! Is it still working?