使用Gmail登录无效

编程入门 行业动态 更新时间:2024-10-09 10:28:05
本文介绍了使用Gmail登录无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我在登录页面上有一个按钮使用Gmail登录

I have a button on my site on Login Page "Login with Gmail"

<asp:Button ID="btnLoginToGoogle" runat="server" OnCommand="OpenLogin_Click" ToolTip="Google_Login" CssClass="ch_google_button" CommandArgument="www.google/accounts/o8/id" Width="141px" />

C#代码是:

C# code is :

protected void OpenLogin_Click(object src, CommandEventArgs e) { try { string discoveryUri = e.CommandArgument.ToString(); var b = new UriBuilder(Request.Url) { Query = "" }; var req = openid.CreateRequest(discoveryUri, b.Uri, b.Uri); var fetchRequest = new FetchRequest(); fetchRequest.Attributes.AddRequired(WellKnownAttributes.Contact.Email); fetchRequest.Attributes.AddRequired(WellKnownAttributes.Name.First); fetchRequest.Attributes.AddRequired(WellKnownAttributes.Name.Last); fetchRequest.Attributes.AddRequired(WellKnownAttributes.Person.Gender); fetchRequest.Attributes.AddRequired(WellKnownAttributes.Contact.Phone.Mobile); fetchRequest.Attributes.AddRequired(WellKnownAttributes.BirthDate.WholeBirthDate); req.AddExtension(fetchRequest); req.RedirectToProvider(); } catch (Exception ex) { } }

代码正在使用框架3.5 但是当我将它转换为框架4.0 它不起作用。 ..... 请解决问题.... Thanx Stack跟踪

Code is working with framework 3.5 But when i convert it to framework 4.0 it's not working...... Please solve the issue.... Thanx Stack Trace

((System.Threading.ThreadAbortException)(ex)) {Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack.} ex.Data Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack. ex.HelpLink Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack. ex.HResult Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack. ex.InnerException Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack. ex.Message Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack. ex.Source Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack. ex.StackTrace Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack. ex.TargetSite Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack.

For All message is same

For All message is same

推荐答案

更多推荐

使用Gmail登录无效

本文发布于:2023-11-09 23:23:48,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1573725.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Gmail

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!