Send MSG and Image Whatspp

 if (String.IsNullOrEmpty(txtMessage.Text))
                return;
            if (WhatSocket.Instance != null)
            {
                if (WhatSocket.Instance.ConnectionStatus == ApiBase.CONNECTION_STATUS.LOGGEDIN)
                {
                  
                 
                    if (txtMessage.Text == "Image")
                    {
                        byte[] img = File.ReadAllBytes(fileName);
                        WhatSocket.Instance.SendMessageImage(txtto.Text + "@s.whatsapp.net", img, ApiBase.ImageType.JPEG);
                    }
                    else {
                        WhatSocket.Instance.SendMessage(txtto.Text, txtMessage.Text);
                    }
                    txtstatus.Text += string.Format("\r\n {0}:{1}", user.Nickname, txtMessage.Text);
                    txtMessage.Clear();
                    txtMessage.Focus();
                }
            }

Post a Comment

1 Comments

  1. i got error yar not authrised
    please give me suggestion

    ReplyDelete