调用WebApi返回的二维数组,如何把它接收完
展开全部
for (int i = 0; i < MyService.getSellInfo("20110101").Length; i++)
{
Console.WriteLine();
for (int j = 0; j < MyService.getSellInfo("20110101")[i].Length; j++)
{
Console.Write(MyService.getSellInfo("20110101")[i][j] + " ");
}
}
改成以下代码
int[][] result = MyService.getSellInfo("20110101");
for (int i = 0; i < result.Length; i++)
{
Console.WriteLine();
for (int j = 0; j < result[i].Length; j++)
{
Console.Write(result[i][j] + " ");
}
}
{
Console.WriteLine();
for (int j = 0; j < MyService.getSellInfo("20110101")[i].Length; j++)
{
Console.Write(MyService.getSellInfo("20110101")[i][j] + " ");
}
}
改成以下代码
int[][] result = MyService.getSellInfo("20110101");
for (int i = 0; i < result.Length; i++)
{
Console.WriteLine();
for (int j = 0; j < result[i].Length; j++)
{
Console.Write(result[i][j] + " ");
}
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询