[C#] 纯文本查看 复制代码 private void button3_Click(object sender, EventArgs e)
{
if (helper == null) MessageBox.Show("先登录!");
try
{
Promotion[] item = helper.GetPromotion();
if (item == null || item.Length == 0) throw new Exception("Promotion is null");
string str1 = item[0].ID;
string str2 = item[0].GroupID;
string html = File.ReadAllText(@"C:\Users\Administrator\Desktop\test.html", Encoding.Default);
string zz = Properties.Resources.zz;
tmall.t getdata = new tmall.t();
dataGridView1.DataSource = getdata.GetTmailData(html, zz, 300, str1, str2, helper);
}
catch
{
//不处理异常,把异常给吃掉。
}
}
用了创建线程来执行最后那一句,但是vs报错,提示不能跨线程调用dataGridView1。
|