我从 txt 文件中读取行。它们大约是 100 000。如何填充队列并打乱其元素?像这样填充队列:
Queue<string> accs = new Queue<string>();
private void loadLikeAccountsToolStripMenuItem_Click(object sender, EventArgs e)
{
OpenFileDialog openFileDialog1 = new OpenFileDialog();
openFileDialog1.RestoreDirectory = true;
openFileDialog1.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*";
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
accs.Clear();
foreach (string s in File.ReadAllLines(openFileDialog1.FileName))
{
accs.Enqueue(s);
}
label4.Text = accs.Count.ToString();
}
}