Click here to Skip to main content
15,891,607 members
Articles / Desktop Programming / Windows Forms

Manage YouTube using C# and Youtube API 1.6

Rate me:
Please Sign up or sign in to vote.
4.96/5 (30 votes)
7 Jan 2011CPOL8 min read 254.2K   18.9K   61  
I describe some of the things about Youtube video feeds
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Google.GData.Client;
using Google.GData.Extensions;
using Google.GData.YouTube;
using Google.GData.Extensions.MediaRss;
using Google.YouTube;

namespace Manager
{
    public partial class Login : Form
    {
        public Login()
        {
            InitializeComponent();
        }

        #region Login

        //insert your dev key here
        string devkey = "";
        

        public void authenticate()
        {
            YouTubeService service = new YouTubeService("Manager");
            service.setUserCredentials(textBox1.Text , maskedTextBox1.Text);

            try
            {
                service.QueryClientLoginToken();
                frmMain frm = new frmMain();
                frm.Username = textBox1.Text;
                frm.Password = maskedTextBox1.Text;
                frm.Show();
                this.Hide();
            }
            catch (System.Net.WebException e)
            {
                MessageBox.Show(e.Message );
            }
        }


        #endregion


        private void button1_Click(object sender, EventArgs e)
        {
            
            if (textBox1.Text != "" && maskedTextBox1.Text != "")
            {
                authenticate();
            }
            else { MessageBox.Show("Enter username and passsword"); }
        }

        private void Login_Load(object sender, EventArgs e)
        {
        }

        private void button2_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer Freelancer
India India
I completed my engineering in 2010.. Then i am working as freelancer.

Comments and Discussions