예제 #1
0
        private void editvideo_Load(object sender, EventArgs e)
        {
            var connectionn = DBFunctions.OpenConnection();

            if (connectionn == null)
            {
                return;
            }

            string sqlText2 = string.Format("SELECT name,videolink,description FROM videos WHERE videolink = '{0}'", link);
            var    reader   = DBFunctions.ExecuteSqlSelect(sqlText2, connectionn);

            if (reader == null)
            {
                return;
            }
            while (reader.Read())
            {
                textBox1.Text = reader[0].ToString();
                textBox2.Text = reader[1].ToString();
                textBox3.Text = reader[2].ToString();
            }
            reader.Close();
            reader.Dispose();
        }
예제 #2
0
        private void updatelikesandviews()
        {
            var connection = DBFunctions.OpenConnection();

            if (connection == null)
            {
                return;
            }

            string sqlText = string.Format("select views,likecount,dislikecount from videos where videolink='{0}';", axShockwaveFlash1.Movie);
            var    reader  = DBFunctions.ExecuteSqlSelect(sqlText, connection);

            if (reader == null)
            {
                return;
            }

            while (reader.Read())
            {
                label8.Text = reader[0].ToString();
                label1.Text = reader[1].ToString();
                label2.Text = reader[2].ToString();
            }
            reader.Close();
            reader.Dispose();
            countlikes();
        }
예제 #3
0
        private void channel_Load(object sender, EventArgs e)
        {
            label4.Width = label3.Width;


            var connectionn = DBFunctions.OpenConnection();

            if (connectionn == null)
            {
                return;
            }

            string sqltxt = string.Format("SELECT username from logins where id='{0}';", Convert.ToInt64(id));
            var    reader = DBFunctions.ExecuteSqlSelect(sqltxt, connectionn);

            if (reader == null)
            {
                return;
            }
            while (reader.Read())
            {
                label3.Text = reader[0].ToString();
            }
            reader.Close();
            reader.Dispose();

            mn.loadchannel(Convert.ToInt64(id));
        }
예제 #4
0
        private void watchvideo_Load_1(object sender, EventArgs e)
        {
            axShockwaveFlash1.Movie = link;

            timer1.Enabled = true;

            var connection = DBFunctions.OpenConnection();

            if (connection == null)
            {
                return;
            }

            string sqlText = string.Format("select * from videos where videolink='{0}';", axShockwaveFlash1.Movie);
            var    reader  = DBFunctions.ExecuteSqlSelect(sqlText, connection);

            if (reader == null)
            {
                return;
            }

            while (reader.Read())
            {
                label9.Text   = reader[1].ToString();
                label13.Text  = reader[2].ToString();
                label8.Text   = reader[4].ToString();
                label1.Text   = reader[5].ToString();
                label2.Text   = reader[6].ToString();
                label3.Text   = reader[8].ToString();
                textBox3.Text = reader[7].ToString();
                videoID       = (ulong)reader[0];
            }
            reader.Close();
            reader.Dispose();
            string sqltxt  = string.Format("SELECT username,subscribers from logins where id='{0}';", Convert.ToInt64(label9.Text));
            var    reader2 = DBFunctions.ExecuteSqlSelect(sqltxt, connection);

            if (reader2 == null)
            {
                return;
            }
            while (reader2.Read())
            {
                label9.Text  = reader2[0].ToString();
                label11.Text = reader2[1].ToString();
            }
            reader2.Close();
            reader2.Dispose();
            connection.Close();
            connection.Dispose();
            coutviews();
            if (active == true)
            {
                updatelikesandviews();
                loadlikeordislike();
            }
        }
예제 #5
0
        private void label10_Click(object sender, EventArgs e)
        {
            if (CheckFields() == true)
            {
                //checking if registration data is unique or is not empty
                string komanda1 = string.Format("SELECT count(id) FROM logins WHERE UserName = '******';", textBox1.Text);
                string komanda2 = string.Format("SELECT count(id) FROM logins WHERE email = '{0}';", textBox4.Text);

                var connection = DBFunctions.OpenConnection(); //get connection to server
                if (connection == null)
                {
                    return;
                }

                var cmd1 = DBFunctions.ExecuteSqlScalar(komanda1, connection);
                var cmd2 = DBFunctions.ExecuteSqlScalar(komanda2, connection);

                int countuser  = Convert.ToInt32(cmd1);
                int countemail = Convert.ToInt32(cmd2);

                if (countuser != 0)
                {
                    MessageBox.Show("User with this username already exists");

                    label1.Enabled = true;
                    return;
                }

                if (countemail != 0)
                {
                    MessageBox.Show("User with this email already exists");

                    label1.Enabled = true;
                    return;
                }
                try
                {
                    sendRegInfoToDatabase(textBox1.Text, textBox2.Text, textBox4.Text, "red", 0);
                    MessageBox.Show("User created successfully!", "Welcome", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                catch (Exception)
                {
                    MessageBox.Show("Test");
                }


                this.ResetText();
                this.Close();
            }
            else
            {
                MessageBox.Show("Wrong SIGN UP info");
            }
        }
예제 #6
0
        private void label7_Click(object sender, EventArgs e)
        {
            if (active == false)
            {
                MessageBox.Show("You need to login first!");
                return;
            }
            if (label7.ForeColor == Color.WhiteSmoke)
            {
                string sqlText    = "SELECT DislikeCount from videos where videolink='" + axShockwaveFlash1.Movie + "';";
                var    connection = DBFunctions.OpenConnection();
                if (connection == null)
                {
                    return;
                }
                ulong dislikes = (ulong)DBFunctions.ExecuteSqlScalar(sqlText, connection);
                dislikes++;
                string sqlText2 = string.Format("UPDATE videos SET dislikecount='{0}' WHERE videolink='{1}';", dislikes, axShockwaveFlash1.Movie);

                DBFunctions.ExecuteSqlNoReturn(sqlText2, connection);
                connection.Close();
                connection.Dispose();
                label7.ForeColor = Color.Red;
                like.Enabled     = false;
                connection.Close();
                connection.Dispose();
                updatelikesandviews();
                addtodislikedvideos();
            }
            else if (label7.ForeColor == Color.Red)
            {
                string sqlText    = "select dislikecount from videos where videolink='" + axShockwaveFlash1.Movie + "';";
                var    connection = DBFunctions.OpenConnection();
                if (connection == null)
                {
                    return;
                }
                ulong dislikes = (ulong)DBFunctions.ExecuteSqlScalar(sqlText, connection);
                dislikes--;
                string sqlText2 = string.Format("UPDATE videos SET dislikecount='{0}' WHERE videolink='{1}';", dislikes, axShockwaveFlash1.Movie);

                DBFunctions.ExecuteSqlNoReturn(sqlText2, connection);
                connection.Close();
                connection.Dispose();
                label7.ForeColor = Color.WhiteSmoke;
                like.Enabled     = true;
                connection.Close();
                connection.Dispose();
                updatelikesandviews();
                deletefromdislikedvideos();
            }
        }
예제 #7
0
        private void addtodislikedvideos()
        {
            var connection = DBFunctions.OpenConnection();

            if (connection == null)
            {
                return;
            }
            string sqlText2 = string.Format("INSERT INTO dislikes VALUES(null, {0}, {1});", videoID, user.user_ID);

            DBFunctions.ExecuteSqlNoReturn(sqlText2, connection);
            connection.Close();
            connection.Dispose();
        }
예제 #8
0
        private void deletefromdislikedvideos()
        {
            var connection = DBFunctions.OpenConnection();

            if (connection == null)
            {
                return;
            }
            string sqlText2 = string.Format("DELETE FROM dislikes WHERE videoID = {0} AND userID = {1};", videoID, user.user_ID);

            DBFunctions.ExecuteSqlNoReturn(sqlText2, connection);
            connection.Close();
            connection.Dispose();
        }
예제 #9
0
        private void sendRegInfoToDatabase(string username, string password, string email, string color, int subs)
        {
            string sqlText = string.Format("INSERT INTO logins VALUES(null,'{0}','{1}','{2}','{3}',{4});", username, PasswordClass.GetMD5hash(textBox3.Text), email, color, subs);

            var connection = DBFunctions.OpenConnection(); //get connection to server

            if (connection == null)
            {
                return;
            }
            DBFunctions.ExecuteSqlNoReturn(sqlText, connection);
            connection.Close();
            connection.Dispose();
        }
예제 #10
0
        private void sendRegInfoToDatabase(ulong channelID, string name, string videolink, ulong views, ulong likes, ulong dislikes, string discription, DateTime uploadtime)
        {
            string sqlText = string.Format("INSERT INTO videos VALUES(null,{0},'{1}','{2}',{3},{4},{5},'{6}','{7}');", channelID, name, videolink, views, likes, dislikes, discription, uploadtime.ToString());

            var connection = DBFunctions.OpenConnection(); //get connection to server

            if (connection == null)
            {
                return;
            }
            DBFunctions.ExecuteSqlNoReturn(sqlText, connection);
            connection.Close();
            connection.Dispose();
        }
예제 #11
0
        private void coutviews()
        {
            string sqlText    = "select views from videos where videolink='" + axShockwaveFlash1.Movie + "';";
            var    connection = DBFunctions.OpenConnection();

            if (connection == null)
            {
                return;
            }
            ulong views = (ulong)DBFunctions.ExecuteSqlScalar(sqlText, connection);

            views++;
            string sqlText2 = string.Format("UPDATE videos SET views='{0}' WHERE videolink='{1}';", views, axShockwaveFlash1.Movie);

            DBFunctions.ExecuteSqlNoReturn(sqlText2, connection);
            connection.Close();
            connection.Dispose();
        }
예제 #12
0
        private void button2_Click(object sender, EventArgs e)
        {
            if (textBox1.Text == textBox2.Text)
            {
                string sqlText    = string.Format("select password from logins where email='{0}';", emailas);
                var    connection = DBFunctions.OpenConnection();
                if (connection == null)
                {
                    return;
                }
                OldPassword = (string)DBFunctions.ExecuteSqlScalar(sqlText, connection);

                sqlText = string.Format("UPDATE logins SET Password='******' WHERE Password='******';", PasswordClass.GetMD5hash(textBox2.Text), OldPassword);

                DBFunctions.ExecuteSqlNoReturn(sqlText, connection);
                connection.Close();
                connection.Dispose();
            }
        }
예제 #13
0
        private void label10_Click(object sender, EventArgs e)
        {
            string link;

            link = textBox2.Text.Replace("watch?v=", "v/");

            if (CheckFields() == true)
            {
                //checking if registration data is unique or is not empty
                string komanda1 = string.Format("SELECT count(id) FROM videos WHERE videolink = '{0}';", textBox2.Text);

                var connection = DBFunctions.OpenConnection(); //get connection to server
                if (connection == null)
                {
                    return;
                }

                var cmd1 = DBFunctions.ExecuteSqlScalar(komanda1, connection);

                int countlinks = Convert.ToInt32(cmd1);

                if (countlinks != 0)
                {
                    MessageBox.Show("This video already exists");
                    return;
                }
                try
                {
                    sendRegInfoToDatabase(user.user_ID, textBox1.Text, link, 0, 0, 0, textBox3.Text, DateTime.Now);
                }
                catch (Exception)
                {
                }
                MessageBox.Show("Video upoloaded successfully!", "Welcome", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.Close();
            }
            else
            {
                MessageBox.Show("Failed to upload video");
            }
        }
예제 #14
0
        private void label10_Click(object sender, EventArgs e)
        {
            try
            {
                var connection = DBFunctions.OpenConnection();
                if (connection == null)
                {
                    return;
                }

                string sqlText = string.Format("UPDATE videos SET name='{0}',videolink = '{1}',description = '{2}' WHERE videolink='{3}';", textBox1.Text, textBox2.Text, textBox3.Text, link);

                DBFunctions.ExecuteSqlNoReturn(sqlText, connection);
                connection.Close();
                connection.Dispose();
                MessageBox.Show("Video was succsesfully updated!");
                this.Hide();
            }
            catch
            {
                MessageBox.Show("Failed while updating video!");
            }
        }
예제 #15
0
        private void filllusername(long labelid, LinkLabel labelname)
        {
            var connectionn = DBFunctions.OpenConnection();

            if (connectionn == null)
            {
                return;
            }

            string sqltxt  = string.Format("SELECT username from logins where id='{0}';", Convert.ToInt64(labelid));
            var    reader2 = DBFunctions.ExecuteSqlSelect(sqltxt, connectionn);

            if (reader2 == null)
            {
                return;
            }
            while (reader2.Read())
            {
                labelname.Text = reader2[0].ToString();
            }
            reader2.Close();
            reader2.Dispose();
        }
예제 #16
0
        private void loadlikeordislike()
        {
            string sqlText    = string.Format("select count(id) from likes where videoid={0} AND userID = {1};", videoID, user.user_ID);
            var    connection = DBFunctions.OpenConnection();

            if (connection == null)
            {
                return;
            }

            var cmd       = DBFunctions.ExecuteSqlScalar(sqlText, connection);
            int countuser = Convert.ToInt32(cmd);

            if (countuser == 1)
            {
                like.ForeColor = Color.Red;
                label7.Enabled = false;
            }


            sqlText    = string.Format("select count(id) from dislikes where videoid={0} AND userID = {1};", videoID, user.user_ID);
            connection = DBFunctions.OpenConnection();
            if (connection == null)
            {
                return;
            }

            cmd       = DBFunctions.ExecuteSqlScalar(sqlText, connection);
            countuser = Convert.ToInt32(cmd);
            if (countuser == 1)
            {
                label7.ForeColor = Color.Red;
                like.Enabled     = false;
            }
            connection.Close();
            connection.Dispose();
        }
예제 #17
0
        private void label10_Click(object sender, EventArgs e)
        {
            string sqlText    = "select count(id) from logins where UserName='******';";
            var    connection = DBFunctions.OpenConnection();

            if (connection == null)
            {
                return;
            }
            if ((long)DBFunctions.ExecuteSqlScalar(sqlText, connection) == 0)
            {
                MessageBox.Show("User does not exist");
                return;
            }

            sqlText = string.Format("select id,username,password,email,ChannelColour,subscribers from logins where Username='******' and Password='******';", textBox1.Text, PasswordClass.GetMD5hash(textBox2.Text));
            var reader = DBFunctions.ExecuteSqlSelect(sqlText, connection);

            if (reader == null)
            {
                return;
            }
            if (!reader.HasRows)
            {
                MessageBox.Show("Wrong password", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            userData user = new userData();

            while (reader.Read())
            {
                user.user_ID          = (ulong)reader[0];
                user.user_username    = reader[1].ToString();
                user.user_password    = reader[2].ToString();
                user.user_email       = reader[3].ToString();
                user.user_colour      = reader[4].ToString();
                user.user_subscribers = reader[5].ToString();
            }
            reader.Close();
            reader.Dispose();
            connection.Close();
            connection.Dispose();
            //open main form
            prnt.loaduser(user);

            prnt.label2.Visible = false;

            prnt.panel2.Visible = true;

            prnt.label12.Text = user.user_username;
            Color red = Color.FromName(user.user_colour);

            prnt.label6.BackColor = red;
            prnt.active           = true;

            if (prnt.Controls.ContainsKey("hmw"))
            {
                prnt.Controls.RemoveByKey("hmw");
                prnt.loadtrends();
            }
            if (prnt.Controls.ContainsKey("wthvid"))
            {
                prnt.loadtrends();
            }

            this.Close();
        }
예제 #18
0
        private void historyBtn_Click(object sender, EventArgs e)
        {
            MessageBox.Show("COMING SOON!!!!");
            return;

            if (this.Controls.ContainsKey("hmw"))
            {
                this.Controls.RemoveByKey("hmw");
            }
            if (this.Controls.ContainsKey("wthvid"))
            {
                this.Controls.RemoveByKey("wthvid");
            }
            if (this.Controls.ContainsKey("channel"))
            {
                this.Controls.RemoveByKey("channel");
            }

            Subscriptions sbs = new Subscriptions();

            sbs.Name = "hmw";

            var connectionn = DBFunctions.OpenConnection();

            if (connectionn == null)
            {
                return;
            }

            int y = 10;

            string sqlText1 = string.Format("SELECT videos.name,videos.views,videos.ChannelID,videos.videolink,videos.uploaddate,historyvideo.videoid FROM video JOIN historyvideo ON historyvideo.userid = {0};", user.user_ID);
            var    readerr  = DBFunctions.ExecuteSqlSelect(sqlText1, connectionn);

            if (readerr == null)
            {
                return;
            }

            while (readerr.Read())
            {
                //string sqlText3 = string.Format("SELECT username from logins where ID = {0};", readerr[2] );
                //  string name = (string)DBFunctions.ExecuteSqlScalar(sqlText3, connectionn);

                vid_his_sub vidsub = new vid_his_sub();

                vidsub.label1.Text     = readerr[1].ToString();
                vidsub.linkLabel1.Text = readerr[0].ToString();
                vidsub.linkLabel3.Text = readerr[5].ToString();
                vidsub.linkLabel2.Text = readerr[5].ToString();
                vidsub.linkLabel1.Name = readerr[3].ToString();
                vidsub.textBox3.Text   = readerr[6].ToString();

                //vidsub.linkLabel1.Click += LinkLabel1_Click;
                vidsub.linkLabel1.Click += LinkLabel1_Click;

                string a = getYouTubeThumbnail(readerr[3].ToString());

                var request = WebRequest.Create(a);

                using (var response = request.GetResponse())
                    using (var stream = response.GetResponseStream())
                    {
                        vidsub.pictureBox1.Image = Bitmap.FromStream(stream);
                    }

                vidsub.Location = new Point(0, y);
                sbs.panel1.Controls.Add(vidsub);

                y += 200;
            }
            sbs.Location = new Point(259, 124);
            this.Controls.Add(sbs);
            readerr.Close();
            readerr.Dispose();
        }
예제 #19
0
        private void pictureBox2_Click(object sender, EventArgs e)
        {
            if (this.Controls.ContainsKey("hmw"))
            {
                this.Controls.RemoveByKey("hmw");
            }
            if (this.Controls.ContainsKey("wthvid"))
            {
                this.Controls.RemoveByKey("wthvid");
            }
            if (this.Controls.ContainsKey("channel"))
            {
                this.Controls.RemoveByKey("channel");
            }

            Subscriptions sbs = new Subscriptions();

            sbs.Name = "hmw";

            var connectionn = DBFunctions.OpenConnection();

            if (connectionn == null)
            {
                return;
            }

            int y = 10;

            string sqlText = string.Format("SELECT videos.name,videos.views,videos.ChannelID,videos.videolink,videos.uploaddate,logins.username, videos.description FROM videos JOIN logins ON videos.channelid = logins.ID WHERE videos.name LIKE '%{0}%' ORDER BY uploaddate DESC limit 12 ;", textBox1.Text);
            var    readerr = DBFunctions.ExecuteSqlSelect(sqlText, connectionn);

            if (readerr == null)
            {
                return;
            }

            while (readerr.Read())
            {
                //string sqlText3 = string.Format("SELECT username from logins where ID = {0};", readerr[2] );
                //  string name = (string)DBFunctions.ExecuteSqlScalar(sqlText3, connectionn);

                vid_his_sub vidsub = new vid_his_sub();

                vidsub.label1.Text     = readerr[1].ToString() + " views";
                vidsub.linkLabel1.Text = readerr[0].ToString();
                vidsub.linkLabel3.Hide();
                vidsub.linkLabel2.Text = readerr[5].ToString();
                vidsub.linkLabel1.Name = readerr[3].ToString();
                vidsub.textBox3.Text   = readerr[6].ToString();

                vidsub.linkLabel2.Name   = readerr[2].ToString();
                vidsub.linkLabel1.Click += LinkLabel1_Click;
                vidsub.linkLabel2.Click += LinkLabel2_Click;

                string a = getYouTubeThumbnail(readerr[3].ToString());

                var request = WebRequest.Create(a);

                using (var response = request.GetResponse())
                    using (var stream = response.GetResponseStream())
                    {
                        vidsub.pictureBox1.Image = Bitmap.FromStream(stream);
                    }

                vidsub.Location   = new Point(0, y);
                sbs.panel1.Height = this.Height - groupBox1.Height - 80;
                sbs.panel1.Controls.Add(vidsub);

                y += 200;
            }
            sbs.Location = new Point(259, 124);
            this.Controls.Add(sbs);
            readerr.Close();
            readerr.Dispose();
        }
예제 #20
0
        public void loadchannel(long id)
        {
            var connectionn = DBFunctions.OpenConnection();

            if (connectionn == null)
            {
                return;
            }
            channel chl    = new channel();
            int     x      = 10;
            int     y      = 10;
            int     arjau  = 0;
            string  sqlTxt = string.Format("SELECT username from logins where id = {0}", id);
            var     read   = DBFunctions.ExecuteSqlSelect(sqlTxt, connectionn);

            if (read == null)
            {
                return;
            }
            while (read.Read())
            {
                username = read[0].ToString();
            }
            read.Close();
            read.Dispose();

            string sqlText1 = string.Format("SELECT videos.name,videos.views,videos.ChannelID,videos.videolink,videos.uploaddate FROM videos WHERE channelID = {0};", id);
            var    readerr  = DBFunctions.ExecuteSqlSelect(sqlText1, connectionn);

            if (readerr == null)
            {
                return;
            }

            while (readerr.Read())
            {
                //string sqlText3 = string.Format("SELECT username from logins where ID = {0};", readerr[2] );
                //  string name = (string)DBFunctions.ExecuteSqlScalar(sqlText3, connectionn);

                vid vidd = new vid();
                vidd.label1.Text     = readerr[1].ToString();
                vidd.linkLabel1.Text = readerr[0].ToString() + " views";
                vidd.linkLabel2.Text = username;
                vidd.linkLabel1.Name = readerr[3].ToString();
                vidd.linkLabel2.Name = readerr[2].ToString();
                if (active == true && Convert.ToUInt64(readerr[2]) == user.user_ID)
                {
                    vidd.button1.Visible = true;
                    vidd.button1.Name    = readerr[3].ToString();
                }
                else
                {
                    vidd.button1.Visible = false;
                }
                vidd.linkLabel1.Name   = readerr[3].ToString();
                vidd.linkLabel1.Click += LinkLabel1_Click;

                string a = getYouTubeThumbnail(readerr[3].ToString());

                var request = WebRequest.Create(a);

                using (var response = request.GetResponse())
                    using (var stream = response.GetResponseStream())
                    {
                        vidd.pictureBox1.Image = Bitmap.FromStream(stream);
                    }

                vidd.Location = new Point(x, y);

                chl.panel1.Controls.Add(vidd);
                arjau++;
                x += 220;

                if (arjau == 4)
                {
                    x     = 10;
                    y    += 200;
                    arjau = 0;
                }
            }

            readerr.Close();
            readerr.Dispose();
            connectionn.Close();
            connectionn.Dispose();
        }
예제 #21
0
        public void loaduploads()
        {
            if (this.Controls.ContainsKey("hmw"))
            {
                this.Controls.RemoveByKey("hmw");
            }
            if (this.Controls.ContainsKey("wthvid"))
            {
                this.Controls.RemoveByKey("wthvid");
            }
            if (this.Controls.ContainsKey("channel"))
            {
                this.Controls.RemoveByKey("channel");
            }

            homeview hmv = new homeview(this);

            hmv.Name             = "hmw";
            hmv.label4.BackColor = Color.Red;

            var connectionn = DBFunctions.OpenConnection();

            if (connectionn == null)
            {
                return;
            }


            int x     = 10;
            int y     = 10;
            int arjau = 0;

            string sqlText1 = string.Format("SELECT videos.name,videos.views,videos.ChannelID,videos.videolink,videos.uploaddate,logins.username FROM videos JOIN logins ON videos.channelid = logins.ID ORDER BY uploaddate DESC limit 16;");
            var    readerr  = DBFunctions.ExecuteSqlSelect(sqlText1, connectionn);

            if (readerr == null)
            {
                return;
            }

            while (readerr.Read())
            {
                //string sqlText3 = string.Format("SELECT username from logins where ID = {0};", readerr[2] );
                //  string name = (string)DBFunctions.ExecuteSqlScalar(sqlText3, connectionn);

                vid vidd = new vid();
                vidd.label1.Text     = readerr[1].ToString();
                vidd.linkLabel1.Text = readerr[0].ToString() + " views";
                vidd.linkLabel2.Text = readerr[5].ToString();
                vidd.linkLabel1.Name = readerr[3].ToString();
                vidd.linkLabel2.Name = readerr[2].ToString();
                if (active == true && Convert.ToUInt64(readerr[2]) == user.user_ID)
                {
                    vidd.button1.Visible = true;
                    vidd.button1.Name    = readerr[2].ToString();
                }
                else
                {
                    vidd.button1.Visible = false;
                }

                vidd.button1.Click    += Button1_Click;
                vidd.linkLabel2.Click += LinkLabel2_Click;
                vidd.linkLabel1.Click += LinkLabel1_Click;

                string a = getYouTubeThumbnail(readerr[3].ToString());

                var request = WebRequest.Create(a);

                using (var response = request.GetResponse())
                    using (var stream = response.GetResponseStream())
                    {
                        vidd.pictureBox1.Image = Bitmap.FromStream(stream);
                    }

                vidd.Location = new Point(x, y);
                hmv.panel1.Controls.Add(vidd);
                arjau++;
                x += 220;

                if (arjau == 4)
                {
                    x     = 10;
                    y    += 200;
                    arjau = 0;
                }
            }
            hmv.Location = new Point(259, 124);
            this.Controls.Add(hmv);
            readerr.Close();
            readerr.Dispose();
            connectionn.Close();
            connectionn.Dispose();
        }