【发布时间】:2019-05-11 03:54:25
【问题描述】:
这是我第一次尝试进行身份验证,但我不太明白。我正在使用 Visual Basic 并安装了 Nuget Podio.Async。
在下面的代码中不会使用应用程序或密码进行身份验证。
当我删除“异步”和“等待”时,它似乎通过了身份验证,但随后我丢失了“item.Fields”。
static void Main()
{
Init();
}
public static async void Init()
{
var podio = new Podio(clientId, clientSecret);
Console.WriteLine("Client ID and Secret");
//await podio.AuthenticateWithApp(appId, appToken);
await podio.AuthenticateWithPassword(username, password);
Console.WriteLine("Authenticated");
var item = await podio.ItemService.GetItem(1124848809);
Console.WriteLine(item.Fields.Count);
}
【问题讨论】: