所以我试图弄清楚如何使用 DataGrid 将 RiotAPI 数据输入到 winforms 中。我设法通过控制台,但在winforms中我试图获得一个将信息输出到Datagrid的按钮。
类程序{
[STAThread]
static void Main(string[] args)
{
var riotApi = RiotApi.NewInstance("apikey");
var summoner = riotApi.SummonerV4.GetBySummonerName(Region.NA, "Username");
Console.WriteLine($"Summoner: {summoner.Name} Level:{summoner.SummonerLevel}");
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
class SummonerV4
{
[JsonProperty("id")]
public string ID { get; set; }
[JsonProperty("accountId")]
public string AccountID { get; set; }
[JsonProperty("puuid")]
public string PuuID { get; set; }
[JsonProperty("name")]
public string Name { get; set; }
[JsonProperty("profileIconId")]
public int ProfileIconId { get; set; }
[JsonProperty("revisionDate")]
public long RevisionDate { get; set; }
[JsonProperty("summonerLevel")]
public long SummerLevel { get; set; }