代码如下
availableUpdate = appUpdater.CheckForUpdate(serverXmlFile, localXmlFile, out htUpdateFile);
if (availableUpdate > 0)
{
this.Invoke(new EventHandler(delegate {
lvUpdateList.BeginUpdate();
for (int i = 0; i < htUpdateFile.Count; i++)
{
string[] fileArray = (string[])htUpdateFile[i];
lvUpdateList.Items.Add(new ListViewItem(fileArray));
}
lvUpdateList.EndUpdate();
}));
}
报错提示是 其他信息: 在创建窗口句柄之前,不能在控件上调用 Invoke 或 BeginInvoke。
如下图