今朝(現在は8時間以上)から修正しようとしている問題があります。FacebookのCookieの内容を取得し、ブラウザでそれ自体で正常に機能する認証トークンを見つけました
だが
ユーザー情報を取得しようとすると、以下のエラーでWebページが非常にうまくクラッシュします。
Webリクエストを使用してページから読み込もうとしました:
'Dim inputFile As String = "https://graph.facebook.com/me?access_token=" & access_token
'Dim sDiskFile As String = "auth.txt"
'Dim _wrequest As WebRequest = WebRequest.Create(inputFile)
'Dim _wresponse As WebResponse
'_wresponse = _wrequest.GetResponse()
'Dim _stream As Stream = _wresponse.GetResponseStream()
'Dim oReader As New StreamReader(_stream, Encoding.ASCII)
そして、それは同じエラーでクラッシュしました。Facebook SDK 5を試してみることにしましたが、同じエラーが発生しています。
Dim access_token As String = GetFacebookTokenFromCookie()
If access_token = "" Then
litUser.Text = "<fb:login-button perms='email'>Login with Facebook</fb:login-button>"
Else
Dim app As New DefaultFBApp
Dim _ctx As New FacebookWebContext(app)
Dim fb As New Facebook.FacebookClient(app)
fb.AccessToken = access_token
Dim parameters As New Dictionary(Of String, Object)()
parameters("fields") = "id,name"
Dim result As Object = fb.Get(parameters)
Dim id = result.id
Dim name = result.name
Dim firstName As String = result.first_name
Dim lastName = result.last_name
Dim link = result.link
Dim username = result.username
Dim gender = result.gender
Dim male = result.locale
litUser.Text = "Welcome " & firstName
End If
DefaultFBApp is:
Public Class DefaultFBApp
Implements Facebook.IFacebookApplication
すべての必須フィールドが追加され、APIキーとシークレットが入力されています。
同じエラー:
Server Error in '/' Application.
A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 69.171.224.21:443
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 69.171.224.21:443
Source Error:
Line 25: parameters("fields") = "id,name"
Line 26:
Line 27: Dim result As Object = fb.Get(parameters)
Line 28:
Line 29: Dim id = result.id
Source File: masterpage.master Line: 27
Stack Trace:
[SocketException (0x274c): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 69.171.224.21:443]
System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) +239
System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP) +35
System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception) +224
[WebExceptionWrapper: Unable to connect to the remote server]
FluentHttp.HttpHelper.OpenRead() +191
Facebook.FacebookClient.Api(String path, IDictionary`2 parameters, HttpMethod httpMethod, Type resultType) +253
Facebook.FacebookClient.Get(IDictionary`2 parameters) +44
ASP.masterpage_master.Page_Load(Object sender, EventArgs e) in E:\kunden\homepages\6\d364763622\www\wsb6301158401\masterpage.master:27
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +50
System.Web.UI.Control.LoadRecursive() +141
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627
バージョン情報:Microsoft .NET Frameworkバージョン:2.0.50727.5446; ASP.NETバージョン:2.0.50727.5420
どんな助けでも大歓迎です