private void button1_Click(object sender, EventArgs e) { if (MessageBox.Show("提交", "", MessageBoxButtons.YesNo) == DialogResult.No) { return; } List <string> bookids = new List <string>(); // 提交 foreach (ListViewItem listViewItem in listView1.Items) { Console.WriteLine(":" + listViewItem.Text); bookids.Add(listViewItem.Text); } BookAPI.BorrowBooks(Program.users, Program.userinfo.userid, bookids); }