以下是我用 vb.net 编写的代码。
Protected Sub OpenIdButton3_LoggedIn(ByVal sender As Object, ByVal e As DotNetOpenAuth.OpenId.RelyingParty.OpenIdEventArgs) 处理 OpenIdButton3.LoggedIn
OpenIdButton3.Visible = False
暗淡的个人资料 As ClaimsResponse = e.Response.GetExtension(Of ClaimsResponse)()
暗淡电子邮件作为字符串 = profile.Email
MsgBox(电子邮件)
结束子
但线
暗淡电子邮件作为字符串 = profile.Email
给出以下错误。
异常详细信息:System.NullReferenceException:对象引用未设置为对象的实例。
我已经阅读了相关文档,并在 webconfig 中实现了 AXFetchAsSregTransform。以下是显示相同的块。
<sectionGroup name="dotNetOpenAuth" type="DotNetOpenAuth.Configuration.DotNetOpenAuthSection, DotNetOpenAuth.Core">
<section name="dotNetOpenAuth" type="DotNetOpenAuth.Configuration.DotNetOpenAuthSection" requirePermission="false" allowLocation="true" />
<section name="openid" type="DotNetOpenAuth.Configuration.OpenIdElement, DotNetOpenAuth.OpenId" requirePermission="false" allowLocation="true" />
<section name="oauth" type="DotNetOpenAuth.Configuration.OAuthElement, DotNetOpenAuth.OAuth" requirePermission="false" allowLocation="true" />
<section name="messaging" type="DotNetOpenAuth.Configuration.MessagingElement, DotNetOpenAuth.Core" requirePermission="false" allowLocation="true" />
<section name="reporting" type="DotNetOpenAuth.Configuration.ReportingElement, DotNetOpenAuth.Core" requirePermission="false" allowLocation="true" />
</sectionGroup>
> <dotNetOpenAuth>
<openid>
<relyingParty>
<add type="DotNetOpenAuth.OpenId.Behaviors.AXFetchAsSregTransform, DotNetOpenAuth" />
</behaviors>
</relyingParty>
</openid>
</dotNetOpenAuth>
即使那样,我似乎也得到了空值。我正在从 Google 获得身份验证。
谁可以帮我这个事?