我想问你为什么我的WebClient会在大约10个结果后停止? 这是代码。
foreach (var player in game["fellowPlayers"])
{
WebClient webC = new WebClient();
TextBlock playerName = new TextBlock();
playerName.Foreground = new SolidColorBrush(Color.FromArgb(255, 255, 205, 3));
Thickness playerMargin = playerName.Margin;
if (player["teamId"].ToString() == teamId)
{
playerMargin.Top = 180 + (30 * teamRedIndex);
playerMargin.Left = 150;
teamRedIndex++;
} else
{
playerMargin.Top = 150 + (30 * teamBlueIndex);
playerMargin.Left = 300;
teamBlueIndex++;
}
playerName.Margin = playerMargin;
matchGrid.Children.Add(playerName);
webC.DownloadStringCompleted += new DownloadStringCompletedEventHandler(playerLoad);
loadPlayer(webC, player["summonerId"].ToString(), playerName);
}
我想得到~50个结果(我的意思是game["fellowPlayers"]
的数量是〜50)。