日期:2014-05-17 浏览次数:21314 次
public void query()
{
StreamReader Sreader = new StreamReader(openFileDialog.FileName.ToString(), Encoding.Default);
string strline = string.Empty;
while ((strline = Sreader.ReadLine()) != null)
{
dataGridView.Rows.Add();
dataGridView.Rows[i].Cells[1].Value = strline.ToString();
}
}
private void input_button_Click(object sender, EventArgs e)
{
i = -1;
openFileDialog.ShowDialog();
dataGridView.Rows.Clear();
Thread querythread = new Thread(query);
Control.CheckForIllegalCrossThreadCalls = false;
querythread.Start();
}