是否可以通过Google API从用户的个人资料中获取信息?如果可能,我应该使用哪个API?
我对这些信息感兴趣:
从用户的个人资料中获取其他信息也很酷.
是否有任何桌面应用程序的代码示例如何授权Google Drive服务并上传文件?
目前我有:
var parameters = new OAuth2Parameters
{
ClientId = ClientCredentials.ClientId,
ClientSecret = ClientCredentials.ClientSecret,
RedirectUri = ClientCredentials.RedirectUris[0],
Scope = ClientCredentials.GetScopes()
};
string url = OAuthUtil.CreateOAuth2AuthorizationUrl(parameters);
// Open url, click to allow and copy secret code
parameters.AccessCode = secretCodeFromBrowser;
OAuthUtil.GetAccessToken(parameters);
string accessToken = parameters.AccessToken;
// So, there is the access token
Run Code Online (Sandbox Code Playgroud)
但接下来的步骤是什么?正如我从示例中看到的,我应该获得IAuthenticator实例并将其传递给DriveService类的构造函数...如何获取IAuthenticator的实例?如果我的上述代码是正确的...提前谢谢.