added exception handling
This commit is contained in:
parent
6c6d373923
commit
bfb76d42d5
@ -12,4 +12,8 @@
|
|||||||
<ProjectReference Include="..\Platonus.API\Platonus.API.csproj" />
|
<ProjectReference Include="..\Platonus.API\Platonus.API.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="DTLib.Ben.Demystifier" Version="1.0.4" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@ -1,24 +1,30 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using DTLib.Ben.Demystifier;
|
||||||
using Platonus.API;
|
using Platonus.API;
|
||||||
using Platonus.API.DataModels;
|
using Platonus.API.DataModels;
|
||||||
|
|
||||||
Console.InputEncoding = Encoding.UTF8;
|
Console.InputEncoding = Encoding.UTF8;
|
||||||
Console.OutputEncoding = Encoding.UTF8;
|
Console.OutputEncoding = Encoding.UTF8;
|
||||||
var p = new PlatonusClient();
|
try
|
||||||
var loginCredentials = new LoginCredentials(
|
|
||||||
ReadString("student id") + "@iitu.edu.kz",
|
|
||||||
ReadString("password", true),
|
|
||||||
PlatonusLanguage.Parse(ReadString("language (en/ru/kz)"))
|
|
||||||
);
|
|
||||||
await p.LoginAsync(loginCredentials);
|
|
||||||
var schedule = await p.GetScheduleAsync();
|
|
||||||
while (true)
|
|
||||||
{
|
{
|
||||||
|
var p = new PlatonusClient();
|
||||||
|
var loginCredentials = new LoginCredentials(
|
||||||
|
ReadString("student id") + "@iitu.edu.kz",
|
||||||
|
ReadString("password", true),
|
||||||
|
PlatonusLanguage.Parse(ReadString("language (en/ru/kz)"))
|
||||||
|
);
|
||||||
|
await p.LoginAsync(loginCredentials);
|
||||||
|
var schedule = await p.GetScheduleAsync();
|
||||||
PrintSchedule(schedule);
|
PrintSchedule(schedule);
|
||||||
Console.ReadKey();
|
|
||||||
}
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Console.WriteLine(ex.ToStringDemystified());
|
||||||
|
}
|
||||||
|
Console.Write("press [ENTER] to exit");
|
||||||
|
Console.ReadLine();
|
||||||
|
|
||||||
|
|
||||||
string ReadString(string question, bool hideInput = false)
|
string ReadString(string question, bool hideInput = false)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user