Ejemplo n.º 1
0
 public void LoginWithGooglePlus()
 {
     GoogleConnect.ClientId     = "618863968324-4a64tsm3ehm6m86135hqpoq75umk1719.apps.googleusercontent.com";
     GoogleConnect.ClientSecret = "G7Zb7XHW-JUjVo6yaQ6USP6_";
     GoogleConnect.RedirectUri  = Request.Url.AbsoluteUri.Split('?')[0];
     GoogleConnect.Authorize("profile", "email");
 }
 public void LoginWithGooglePlus()
 {
     GoogleConnect.ClientId     = "478955962912-3onll49e9glhaa349fttcrl78g1jqhfu.apps.googleusercontent.com";
     GoogleConnect.ClientSecret = "rmBL8avao9OtSaLsILzcdAtM";
     GoogleConnect.RedirectUri  = Request.Url.AbsoluteUri.Split('?')[0];
     GoogleConnect.Authorize("profile", "email");
 }
Ejemplo n.º 3
0
 public void LoginWithGooglePlus()
 {
     GoogleConnect.ClientId     = "508536128158-3v4078lig5vbt6j727okq6ie2b45tg0n.apps.googleusercontent.com";
     GoogleConnect.ClientSecret = "UQlFGFFRQq_Ztfw4FbqzZh_D";
     GoogleConnect.RedirectUri  = Request.Url.AbsoluteUri.Split('?')[0];
     GoogleConnect.Authorize("profile", "email");
 }
Ejemplo n.º 4
0
 public void LoginWithGooglePlus()
 {
     GoogleConnect.ClientId     = "988136019750-lrkpmiauffr8dlbjbqjjmh82aiti7iqs.apps.googleusercontent.com";
     GoogleConnect.ClientSecret = "aMCHg7U8aJhjcvH-A5LiQmvn";
     GoogleConnect.RedirectUri  = Request.Url.AbsoluteUri.Split('?')[0];
     GoogleConnect.Authorize("profile", "email");
 }
 public ActionResult LoginWithGooglePlus(FormCollection form)
 {
     if (form["provider"] == "Google")
     {
         GoogleConnect.ClientId     = "896622894562-eams8dj01aesjt83rq08v7n7qlr42esv.apps.googleusercontent.com";
         GoogleConnect.ClientSecret = "25WEHFLJlTP1136mJx7X4sQb";
         GoogleConnect.RedirectUri  = Request.Url.AbsoluteUri.Split('?')[0];
         // GoogleConnect.RedirectUri = "http://localhost:51442/LoginSocial/LoginWithGooglePlus";
         GoogleConnect.Authorize("profile", "email");
         return(RedirectToAction("LoginWithGooglePlusConfirmed"));
     }
     else if (form["provider"] == "Facebook")
     {
         var fb       = new FacebookClient();
         var loginUrl = fb.GetLoginUrl(new
         {
             client_id     = ConfigurationManager.AppSettings["FbAppId"],
             client_secret = ConfigurationManager.AppSettings["FbAppSecret"],
             redirect_uri  = RedirectUri.AbsoluteUri,
             response_type = "code",
             scope         = "email"
         });
         return(Redirect(loginUrl.AbsoluteUri));
     }
     return(RedirectToAction("LoginWithGooglePlusConfirmed"));
 }
Ejemplo n.º 6
0
 public void LoginWithGooglePlus()
 {
     GoogleConnect.ClientId     = "708368987259-8dtilh79brr03nmuisao8p0atimr80ii.apps.googleusercontent.com";
     GoogleConnect.ClientSecret = "61Pg87LPaI0Mot5VTedVi02O";
     GoogleConnect.RedirectUri  = Request.Url.AbsoluteUri.Split('?')[0];
     GoogleConnect.Authorize("profile", "email");
 }
 public void LoginWithGooglePlus()
 {
     GoogleConnect.ClientId     = "164802556545-rvmd1u9vu1es5ah51tvte7554t9kh4h6.apps.googleusercontent.com";
     GoogleConnect.ClientSecret = "ak0LpmTv8wZI3AVLnyI-1sg3";
     GoogleConnect.RedirectUri  = Request.Url.AbsoluteUri.Split('?')[0];
     GoogleConnect.Authorize("profile", "email");
 }
Ejemplo n.º 8
0
 public void LoginWithGoogle(ClassTemp _lop)
 {
     lop = _lop.lops;
     GoogleConnect.ClientId     = "520808312902-8b27bsq7b88uvjvse8da3svlbue2sb1v.apps.googleusercontent.com";
     GoogleConnect.ClientSecret = "frdbgU0wC677SMYGcxF2zmmP";
     GoogleConnect.RedirectUri  = Request.Url.AbsoluteUri.Split('?')[0];
     GoogleConnect.Authorize("profile", "email");
 }
Ejemplo n.º 9
0
 public ActionResult AuthenGoogle()
 {
     GoogleConnect.ClientId     = "753316382181-58p94cof0aum06tigijhq3e1vlkqlgi8.apps.googleusercontent.com";
     GoogleConnect.ClientSecret = "1WmJi7FEw7rxs71B5EH2aH1f";
     GoogleConnect.RedirectUri  = RedirectUriGoogle.AbsoluteUri.Split('?')[0];
     GoogleConnect.Authorize("profile", "email");
     return(null);
 }
Ejemplo n.º 10
0
 public ActionResult AuthenGoogle()
 {
     GoogleConnect.ClientId     = "929041403867-jj882kepf3cdpcm6dhr2r5qg6hsvrohf.apps.googleusercontent.com";
     GoogleConnect.ClientSecret = "2YuXPruTBTEkEHlkwXuZkvS2";
     GoogleConnect.RedirectUri  = RedirectUriGoogle.AbsoluteUri.Split('?')[0];
     GoogleConnect.Authorize("profile", "email");
     return(null);
 }
Ejemplo n.º 11
0
        public static void Authorize()
        {
            HttpRequest Request = HttpContext.Current.Request;

            if (Request != null)
            {
                GoogleConnect.ClientId     = ApiSettings.Default.GoogleClientId;
                GoogleConnect.ClientSecret = ApiSettings.Default.GoogleClientSecret;

                GoogleConnect googleConnect = new GoogleConnect(SocialRedirectUrl.GetRedirectUrl(SocialSignIn.GoogleRedirectQuery));
                googleConnect.Authorize("profile,email");
            }
        }
Ejemplo n.º 12
0
        /// <summary>
        /// Google the specified return URL.
        /// </summary>
        /// <param name="return_url">The return URL.</param>
        /// <returns>call Google</returns>
        public ActionResult Google(string return_url)
        {
            GoogleConnect.ClientId     = Util.GetConfigValue("AppGoogleID", string.Empty);
            GoogleConnect.ClientSecret = Util.GetConfigValue("AppGoogleSecret", string.Empty);
            GoogleConnect.RedirectUri  = Util.GetConfigValue("Domain", string.Empty) + Url.Action("GoogleCallback", "account");
            if (Url.IsLocalUrl(return_url))
            {
                this.Session["Google_return"] = return_url;
            }

            GoogleConnect.Authorize("profile", "email");
            return(null);
        }
Ejemplo n.º 13
0
        public void Autorizar()
        {
            GoogleConnect.ClientId     = "979504084533-dsaiapt4m4bec0ad5sg459qdn2pe3big.apps.googleusercontent.com";
            GoogleConnect.ClientSecret = "qg0ic-W-odxIrMUS-UM2FpeO";

            string url = Request.Url.AbsoluteUri.Split('?')[0];

            url = url.Substring(0, url.Length - 9) + "ImportarContactos";

            GoogleConnect.RedirectUri = url;


            GoogleConnect.API = EnumAPI.Contacts;
            GoogleConnect.Authorize(Server.UrlEncode("https://www.google.com/m8/feeds/"));
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            GoogleConnect.ClientId     = "";
            GoogleConnect.ClientSecret = "";
            GoogleConnect.RedirectUri  = Request.Url.AbsoluteUri.Split('?')[0];
            GoogleConnect.API          = EnumAPI.Drive;

            if (string.IsNullOrEmpty(Request.QueryString["code"]))
            {
                GoogleConnect.Authorize("https://www.googleapis.com/auth/drive.file");
            }

            if (flagUpdateFile == 0)
            {
                UploadFile();
            }
        }
Ejemplo n.º 15
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            GoogleConnect.ClientId     = "87129835825-ej8e7d4avtumoscft9n8f4t3en59v53r.apps.googleusercontent.com";
            GoogleConnect.ClientSecret = "lxWzgwPCeFalM2CA50blJgSG";
            GoogleConnect.RedirectUri  = Request.Url.AbsoluteUri.Split('?')[0];
            GoogleConnect.API          = EnumAPI.Drive;

            if (!IsPostBack)
            {
                if (string.IsNullOrEmpty(Request.QueryString["code"]))
                {
                    Session["File"]        = fudUploadVideo.PostedFile;
                    Session["Description"] = txtTitle.Text;

                    MailMessage mail = new MailMessage();

                    GoogleConnect.Authorize("https://www.googleapis.com/auth/drive.file");
                    //GoogleConnect.Authorize("https://script.google.com/macros/s/AKfycbwuhtSthejPvSqcC0pNR2Blw1yuwyqIj5hvyd_JPJIdeNSlD_tn/exec");
                }
                if (Session["UserId"] != null)
                {
                    if (Convert.ToInt32(Session["UserId"].ToString()) == 1)
                    {
                        Display_List(gvadvertisement, "SELECT Advertisement_Id,Title,Tag,convert(varchar(12),StartDate,100)as StartDate,convert(varchar(12),EndDate,100)as EndDate,NoofVisits,Budget,PromoCode,Status,Description,Video,CreatedDate,CreatedById,ModifiedDate,ModifiedById,Isactive,case when Status='Approve' then 'label label-success' else case when Status='Unapprove' then 'label label-danger' else 'label label-warning' end end as StatusClr FROM tbl_Advertisement where Isactive='True'");
                    }
                    else
                    {
                        Display_List(gvadvertisement, "SELECT Advertisement_Id,Title,Tag,convert(varchar(12),StartDate,100)as StartDate,convert(varchar(12),EndDate,100)as EndDate,NoofVisits,Budget,PromoCode,Status,Description,Video,CreatedDate,CreatedById,ModifiedDate,ModifiedById,Isactive,case when Status='Approve' then 'label label-success' else case when Status='Unapprove' then 'label label-danger' else 'label label-warning' end end as StatusClr FROM tbl_Advertisement where Isactive='True' and CreatedById=" + Convert.ToInt32(Session["UserId"].ToString()));
                    }
                }
                else
                {
                    ShowNotification("Advertisement", "Sorry, Your Session had been Expired.. So Please Logout Once & Login Again..!", NotificationType.error);
                }
            }
        }
        catch (Exception Ex)
        {
        }
    }
Ejemplo n.º 16
0
 protected void LinkButton2_Click(object sender, EventArgs e)
 {
     GoogleConnect.Authorize("profile", "email");
     GoogleConnect.Clear(Request.QueryString["code"]);
 }
Ejemplo n.º 17
0
    protected void Page_Load(object sender, EventArgs e)
    {
        GoogleConnect.ClientId     = "164237056287-bjbbnsmtbucn0rslfv4t5h01ircp9rpm.apps.googleusercontent.com";
        GoogleConnect.ClientSecret = "wDxJZzI3s-AsV-FY9tt0w22M";

        GoogleConnect.RedirectUri = Request.Url.AbsoluteUri.Split('?')[0];

        if (!string.IsNullOrEmpty(Request.QueryString["code"]))
        {
            string        code    = Request.QueryString["code"];
            string        json    = GoogleConnect.Fetch("me", code);
            GoogleProfile profile = new JavaScriptSerializer().Deserialize <GoogleProfile>(json);
            //lblId.Text = profile.Id;
            //lblName.Text = profile.DisplayName;
            //lblEmail.Text = profile.Emails.Find(email => email.Type == "account").Value;
            //lblGender.Text = profile.Gender;
            //lblType.Text = profile.ObjectType;
            //ProfileImage.ImageUrl = profile.Image.Url;
            //pnlProfile.Visible = true;
            //btnLogin.Enabled = false;
            string testing = Convert.ToString(profile.Image.Url);
            //////code try Google/////
            string checkuser = "******" + profile.Emails.Find(email => email.Type == "account").Value.ToString() + "'";
            int    temp      = c.getCount(checkuser);
            if (temp == 1)
            {
                cmd = new SqlCommand("select uid, uemail,uname, upassword from[dbo].[userprofile] where uemail = @uemail", c.conn);
                cmd.Parameters.AddWithValue("@uemail", Convert.ToString(profile.Emails.Find(email => email.Type == "account").Value));
                c.Retrieve(cmd);
                while (c.dr.Read())
                {
                    HttpCookie cookie = new HttpCookie("userinfo");
                    cookie["email"] = Convert.ToString(c.dr["uemail"]);
                    cookie["uid"]   = Convert.ToString(c.dr["uid"]);
                    cookie.Expires  = DateTime.Now.AddDays(30);
                    Response.Cookies.Add(cookie);
                    Response.Redirect("../Default.aspx");
                }
            }
            else
            {
                cmd = new SqlCommand("INSERT INTO [dbo].[userprofile] (uname,uemail,uregisteredon,ustatus) VALUES (@uname,@uemail,@uregisteredon,@ustatus)", c.conn);
                cmd.Parameters.AddWithValue("@uname", profile.DisplayName.ToString());
                cmd.Parameters.AddWithValue("@uemail", profile.Emails.Find(email => email.Type == "account").Value.ToString());
                cmd.Parameters.AddWithValue("@uregisteredon", System.DateTime.Today);
                cmd.Parameters.AddWithValue("@ustatus", "V");
                c.Insert(cmd);

                cmd = new SqlCommand("select uid, uemail, upassword from[dbo].[userprofile] where uemail = @uemail", c.conn);
                cmd.Parameters.AddWithValue("@uemail", profile.Emails.Find(email => email.Type == "account").Value.ToString());
                c.Retrieve(cmd);
                while (c.dr.Read())
                {
                    HttpCookie cookie = new HttpCookie("userinfo");
                    cookie["email"] = Convert.ToString(c.dr["uemail"]);
                    cookie["uid"]   = Convert.ToString(c.dr["uid"]);
                    cookie.Expires  = DateTime.Now.AddDays(30);
                    Response.Cookies.Add(cookie);
                    Response.Redirect("../Default.aspx");
                }
            }
            //////code try Google/////
        }
        if (Request.QueryString["error"] == "access_denied")
        {
            ClientScript.RegisterClientScriptBlock(this.GetType(), "alert", "alert('Access denied.')", true);
        }
        GoogleConnect.Authorize("profile", "email");
    }
Ejemplo n.º 18
0
 protected void btnGoogle_Click(object sender, EventArgs e)
 {
     GoogleConnect.Authorize("profile", "email");
 }
Ejemplo n.º 19
0
    private void LbtnGoogle_Click(object sender, EventArgs e)
    {
        Session["GoogleLogin"] = true;

        GoogleConnect.Authorize("profile", "email");
    }
Ejemplo n.º 20
0
 protected void LinkButton_LoginGoogle_Click(object sender, EventArgs e)
 {
     GoogleConnect.Authorize("profile");
 }
Ejemplo n.º 21
0
        protected void UploadFile(object sender, EventArgs e)
        {
            Microsoft.Office.Interop.Excel.Application xlApp = new Microsoft.Office.Interop.Excel.Application();

            if (xlApp == null)
            {
            }


            xlApp.DisplayAlerts = false;
            string filePath = @"C:\Users\Shilpa\Downloads\" + ((System.Web.UI.WebControls.FileUpload)(FindControl("FileUpload1"))).FileName;

            Microsoft.Office.Interop.Excel.Workbook xlWorkBook = xlApp.Workbooks.Open(filePath, 0, false, 5, "", "", false, Microsoft.Office.Interop.Excel.XlPlatform.xlWindows, "", true, false, 0, true, false, false);
            //Microsoft.Office.Interop.Excel.Sheets worksheets = xlWorkBook.Worksheets;

            Worksheet wkSheet = new Worksheet();

            xlApp.DisplayAlerts = false;
            //for (int i = xlApp.ActiveWorkbook.Worksheets.Count; i > 0; i--)
            for (int i = xlApp.ActiveWorkbook.Worksheets.Count; i > 0; i--)
            {
                //wkSheet = (Worksheet)xlApp.ActiveWorkbook.Worksheets[i];
                wkSheet = xlWorkBook.Worksheets[i];
                if (wkSheet.Name != "Table 2")
                {
                    wkSheet.Delete();
                }
            }
            xlApp.DisplayAlerts = true;
            xlWorkBook.Save();

            string filename = Path.GetFileName(FileUpload1.FileName);

            FileUpload1.SaveAs(Server.MapPath("~/") + filename);
            //HttpPostedFile upload = Server.MapPath("~/") + filename;
            xlWorkBook.Close();

            //releaseObject(worksheets);wkSheet
            releaseObject(wkSheet);
            releaseObject(xlWorkBook);
            releaseObject(xlApp);

            //Session["File"] = filePath;
            HttpFileCollection UploadedFiles = Request.Files;
            HttpPostedFile     UserPostedFile;
            int UploadFileCount = UploadedFiles.Count;

            if (UploadFileCount >= 1)
            {
                for (int i = 0; i < UploadFileCount; ++i)
                {
                    UserPostedFile = UploadedFiles[i];
                    UserPostedFile.SaveAs(@"C:\Users\Shilpa\Downloads\" + UserPostedFile.FileName);
                    Session["File"] = UserPostedFile;
                }
            }

            //Session["File"] = FileUpload1.PostedFile; //UserPostedFile.ToString(); //FileUpload1.PostedFile;
            Session["Description"] = txtDescription.Text;
            GoogleConnect.Authorize("https://www.googleapis.com/auth/drive.file");
        }
Ejemplo n.º 22
0
 public EmptyResult Login_Google()
 {
     GoogleConnect.Authorize("profile", "email");
     return(new EmptyResult());
 }
Ejemplo n.º 23
0
 protected void btnLogin_Click(object sender, EventArgs e)
 {
     GoogleConnect.Authorize("https://www.googleapis.com/auth/drive.file");
 }
Ejemplo n.º 24
0
 protected void Login(object sender, EventArgs e)
 {
     GoogleConnect.Authorize("profile", "email");
 }
        protected void UploadFile(object sender, EventArgs e)
        {
            Session["File"] = FileUpload1.PostedFile;

            GoogleConnect.Authorize("https://www.googleapis.com/auth/drive.file");
        }
Ejemplo n.º 26
0
 protected void B_Ingresar_Gmail_Click(object sender, EventArgs e)
 {
     GoogleConnect.Authorize("profile", "email");
 }
Ejemplo n.º 27
0
 protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
 {
     GoogleConnect.Authorize("profile", "email");
 }