Example #1
0
        private void opendirectory_FileOk(object sender, CancelEventArgs e)
        {
            Image img = Image.FromStream(opendirectory.OpenFile());

            byte[] myarray = imageToByteArray(img);
            int    i       = myarray.Length;

            Server.Service1 server = new Server.Service1();
            try
            {
                server.setChatToImage(lbl_connecteduser.Text, myarray, i, true);
                imagemsg n = new imagemsg(lbl_me.Text, img);
                flowLayoutPanel1.Controls.Add(n);
                flowLayoutPanel1.ScrollControlIntoView(n);
            }
            catch (Exception)
            {
                MessageBox.Show("too big file !");
                this.Show();
            }
        }