Beispiel #1
0
        /// <summary>
        /// Modifica el listbox del principio
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Odyssey_Load(object sender, EventArgs e)
        {
            string ml = Sockets.Conectar(20, name, "1", "", "", "", "");
            int    z  = 0;

            for (int x = 0; x < ml.Length; x++)
            {
                if (ml.Substring(x, 1).Equals("/"))
                {
                    Biblioteca.Items.Add(ml.Substring(z, x - z));
                    z = x + 1;
                }
            }
        }
Beispiel #2
0
        /// <summary>
        /// Ordena por nombre
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button2_Click(object sender, EventArgs e)
        {
            lista.Hide();
            mensajes.Hide();
            general.Hide();
            Biblioteca.Items.Clear();
            string ml = Sockets.Conectar(20, name, "1", "", "", "", "");
            int    z  = 0;

            for (int x = 0; x < ml.Length; x++)
            {
                if (ml.Substring(x, 1).Equals("/"))
                {
                    Biblioteca.Items.Add(ml.Substring(z, x - z));
                    z = x + 1;
                }
            }
        }
Beispiel #3
0
        /// <summary>
        /// Obtiene la lista de mensajes del usuario
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button5_Click(object sender, EventArgs e)
        {
            lista.Hide();
            mensajes.Items.Clear();
            string nombre = Sockets.Conectar(18, name, "", "", "", "", "");
            int    x      = 1;
            int    z      = 0;
            int    k      = 0;
            int    j      = 0;
            int    t      = 0;
            int    y      = 1;

            if (nombre.Length != 0)
            {
                for (int i = 0; nombre.Length > i; i++)
                {
                    if (nombre.Substring(i, 1).Equals("/"))
                    {
                        if (x == 1)
                        {
                            x = 0;
                            t = y - 1;
                            j = 0 - 1;
                            z = i + 1;
                        }
                        else
                        {
                            mensajes.Items.Add(nombre.Substring(k, t) + " - " + nombre.Substring(z, j));
                            k = i + 1;
                            y = 0;
                            x++;
                        }
                    }
                    y++;
                    j++;
                }
            }
            else
            {
                mensajes.Items.Add("No tienes nuevos mensajes");
            }
            mensajes.Show();
        }
Beispiel #4
0
        /// <summary>
        /// Obtiene la lista de amigos
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button6_Click(object sender, EventArgs e)
        {
            lista.Items.Clear();
            mensajes.Hide();
            string nombre = Sockets.Conectar(19, name, "", "", "", "", "");

            if (nombre.Length != 0)
            {
                string[] gen = new string[10];
                int      z   = 0;
                int      j   = 0;
                int      n   = 1;
                for (int c = 0; nombre.Length > c; c++)
                {
                    if (nombre.Substring(c, 1) == "/")
                    {
                        gen[z] = nombre.Substring(j, n - 1);
                        z++;
                        j = c + 1;
                        n = 0;
                    }
                    n++;
                }
                foreach (string usuario in gen)
                {
                    if (usuario != null)
                    {
                        lista.Items.Add(usuario);
                    }
                }
            }
            else
            {
                lista.Items.Add("No tienes amigos");
            }

            lista.Show();
        }
Beispiel #5
0
        /// <summary>
        /// Agrega la cambio a la biblioeca del usuario
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void openFileDialog1_FileOk(object sender, CancelEventArgs e)
        {
            int t = 0;

            foreach (string track in openFileDialog1.FileNames)
            {
                string validacion = Sockets.Conectar(13, name, track, "", "", "", "");
                if (validacion == "true")
                {
                    t++;
                    Biblioteca.Items.Add((Path.GetFileName(track)).Substring(0, (Path.GetFileName(track)).Length - 4));
                }
                else if (validacion == "ya")
                {
                    MessageBox.Show("Ya tienes esta cancion en la biblioteca");
                }
                else
                {
                    MessageBox.Show("El archivo elegido no es mp3");
                }
            }
            MessageBox.Show("Se han cargado " + t + " canciones");
        }