我有以下代码:但我无法响应在列表中写入值以进行调试...
public void LottoWinners(object sender, EventArgs e)
{
Dictionary<int, int> number = new Dictionary<int, int>();
Random generator = new Random();
while (number.Count < 6)
{
number[generator.Next(1, 49)] = 1;
}
int[] lotto = number.Keys.OrderBy(n => n).ToArray();
List<int> lst = lotto.OfType<int>().ToList();
StringBuilder builder = new StringBuilder();
for (int i = 0; i < lst.Count; i++) // Loop through List with for
{
builder.Append(lst).Append("|"); // Append string to StringBuilder
}
string result = builder.ToString(); // Get string from StringBuilder
Response.Write(result);
}
但我所看到的只是我的结果。我应该看到我的清单的价值!
System.Collections.Generic.List`1