(HttpWebRequest)WebRequest.Create(string.Format(“https://graph.facebook.com/oauth/authorize?client_id={0}&redirect_uri={1}”, strClientID, “http://www.facebook.com/connect/login_success.html”));
我正在使用此代码。
但我得到的操作已经超时错误。
你能帮我解决这个问题吗?
这是我的科
getRequest = (HttpWebRequest)WebRequest.Create(string.Format("https://graph.facebook.com/oauth/authorize?client_id={0}&redirect_uri={1}", strClientID, "http://www.facebook.com/connect/login_success.html"));
getRequest.Method = WebRequestMethods.Http.Get;
getRequest.CookieContainer = request.CookieContainer;
getRequest.CookieContainer.Add(cookies);
getRequest.UserAgent = "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.121 Safari/535.2";
getRequest.AllowWriteStreamBuffering = true;
//getRequest.ProtocolVersion = HttpVersion.Version11;
getRequest.AllowAutoRedirect = true;
getRequest.ContentType = "application/x-www-form-urlencoded";
//byteArray = Encoding.ASCII.GetBytes(postData);
//getRequest.ContentLength = byteArray.Length;
//newStream = getRequest.GetRequestStream(); //open connection
//newStream.Write(byteArray, 0, byteArray.Length); // Send the data.
我从这段代码中得到这个错误
getResponse = (HttpWebResponse)getRequest.GetResponse();
请尽快帮助我。感谢所有评论和回复。
提前致谢..