如何从json文件

时间:2017-02-15 10:42:33

标签: c# asp.net-mvc-4 google-calendar-api

我正在阅读json文件中的google api客户端凭据,如下所示,

UserCredential credential;
using (var stream = new FileStream(@"D:\sample\client_secret.json"
, FileMode.Open
, FileAccess.Read))
{
    credential = GoogleWebAuthorizationBroker.AuthorizeAsync(
    GoogleClientSecrets.Load(stream).Secrets,
    new[] { CalendarService.Scope.Calendar },
    "LookIAmAUniqueUser",
    CancellationToken.None,
    new FileDataStore(@"c:\datastore", true)
    ).Result;
}

但是无法从服务器读取凭据,在本地办理登机手续时,它正在精确阅读,任何人都可以建议我

提前致谢

0 个答案:

没有答案