Ejemplo n.º 1
0
        private void action_server_send_media()
        {
            if (shp1.Text.Equals("Empty"))
            {
                _chatstream.Write("" + 0);
                return;
            }
            var ext = shp1.Text.Substring(shp1.Text.Length - 3);

            _chatstream.Write(ext);
            var fi = new FileInfo(_currentpath + "\\" + _nickname + "." + ext);
            var f  = new FileStream(_currentpath + "\\" + _nickname + "." + ext, FileMode.Open);
            var b  = new byte[fi.Length];

            f.Read(b, 0, b.Length);
            f.Close();
            _chatstream.Write("" + b.Length);
            _chatstream.WriteBinary(b);
        }