【发布时间】:2014-08-13 10:36:13
【问题描述】:
我正在尝试这段代码:
PlusService plus = new PlusService(
new Google.Apis.Services.BaseClientService.Initializer()
{
ApiKey = "AIzaSyDWaaG1Hnjgjgho6PVdefefddsdsC6FlPXv5rommyzCAf0ziHkTo"
});
Moment body = new Moment();
ItemScope target = new ItemScope();
target.Id = "103692090756564666566349707";
target.Description = "The description for the activity";
target.Name = "An example of add activity";
body.Target = target;
body.Type = "http://schemas.google.com/AddActivity";
MomentsResource.InsertRequest insert = new MomentsResource.InsertRequest(
plus,
body,
"1036920323290766566566349707",
MomentsResource.InsertRequest.CollectionEnum.Vault);
var momentsResource = plus.Activities.List(
"me",
ActivitiesResource.ListRequest.CollectionEnum.Public);
Moment wrote = insert.Execute();//Error here
我的 scop 脚本是 -
$(location).attr('href', 'https://accounts.google.com/o/oauth2/auth?scope=' +
'https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fplus.login&https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fplus.me&' +
'state=generate_a_unique_state_value&' +
'redirect_uri=http://localhost:58925/Home/&' +
'response_type=code&' +
'client_id=564565402546260119.apps.googleusercontent.com&' +
'access_type=offline');
错误信息是—— 无法加载文件或程序集“Zlib.Portable,Version=1.9.1.9000,Culture=neutral,PublicKeyToken=null”或其依赖项之一。系统找不到指定的文件。
【问题讨论】:
-
这还不是你需要做的,请阅读developers.google.com/accounts/docs/OAuth2并尝试使用google-dotnet-client lib。
标签: c# google-plus