Tag: google plus

如何在Windows应用程序C#.net中获取Google plus访问令牌

我正在准备一个Windows应用程序,因为我想使用oAuth2来访问来自google plus的信息。 但我对以下代码的要求不好。我可以在谷歌控制台中创建应用程序并获取应用程序访问的“代码”。 WebRequest request = WebRequest.Create( GoogleAuthenticationServer.Description.TokenEndpoint ); // You must use POST for the code exchange. request.Method = “POST”; // Create POST data. string postData = FormPostData(code); byte[] byteArray = Encoding.UTF8.`enter code here`GetBytes(postData); // Set up the POST request for the code exchange. request.ContentType = “application/x-www-form-urlencoded”; request.ContentLength = byteArray.Length; Stream dataStream = request.GetRequestStream(); […]