Ejemplo n.º 1
0
 protected bool Login()
 {
     //check if already logged in
     if (!string.IsNullOrEmpty((service.RequestFactory as Google.GData.Client.GDataGAuthRequestFactory).GAuthToken))
     {
         return(true);
     }
     // check if we can login
     if (!string.IsNullOrEmpty(password) && !string.IsNullOrEmpty(login))
     {
         // do login
         service.setUserCredentials(login, password);
         try
         {
             string token = service.QueryClientLoginToken();
             service.SetAuthenticationToken(token);
             return(true);
         }
         catch (Exception ex)
         {
             throw new OnlineVideosException(ex.Message);
         }
     }
     return(false);
 }
Ejemplo n.º 2
0
        public static void Initialize()
        {
            try
            {
                YouTubeService service = new YouTubeService("Manager");
                service.setUserCredentials("*****@*****.**", "AI39si7k1PTGjYF");

                service.QueryClientLoginToken();

                yousettings = new YouTubeRequestSettings("You Manager", "AIzaSyAeo7byS85LCZUtrBodQ6E6OqlFlJROnMA");
                yourequest  = new YouTubeRequest(yousettings);
            }
            catch
            {
            }
        }
Ejemplo n.º 3
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            var service = new YouTubeService("iSpy", MainForm.Conf.YouTubeKey);

            service.setUserCredentials(txtYouTubeUsername.Text, txtYouTubePassword.Text);
            string token = "";

            try
            {
                token = service.QueryClientLoginToken();
            }
            catch (InvalidCredentialsException)
            {
                MessageBox.Show(this, "Login Failed");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            if (token != "")
            {
                MessageBox.Show(this, "Login OK");
            }
        }