|
10金钱
//按钮 如下:具体实现代码。可页面还是假死。不知道我哪一步写错了。求指点。
private void btns_Click(object sender, EventArgs e)
{
for (int i = 0; i < lvlData.Items.Count; i++)
{
string username = lvlData.Items[i].SubItems[1].Text;
string password = lvlData.Items[i].SubItems[2].Text;
Thread pingTask = new Thread(new ThreadStart(delegate
{
Login(username, password,i);
}));
pingTask.Start();
Thread.Sleep(1000);
}
}
//
private void Login(string username, string password,int index)
{
this.BeginInvoke(_upDateStateDelegate, username, password, index);
}
//
private void UpDateDgv(string username, string password,int index)
{
try
{
lvlData.Items[rowId].SubItems[4].Text = username;
}
catch { }
}
|
|