Hey!
I have a problem with my code:
public void UpdateColumn(object stateInformation, int cid = 0, int status = 0)
{
if (InvokeRequired)
{
Invoke(new Action(() => UpdateColumn(stateInformation, cid, status)));
}
else
{
if (status == 0)
{
var res = "Failed";
listView1.Items[cid].SubItems.Add(res);
}
else if (status == 1)
{
var res = "Successful";
listView1.Items[cid].SubItems.Add(res);
}
}
}
public void DoChecking(object iid)
{
var lid = Convert.ToInt32(iid);
var file = openFileDialog1.FileName;
StreamReader read = new StreamReader(file);
var links = read.ReadToEnd();
string[] urls = links.Split('\n');
if (CheckExist(urls[lid]))
{
success++;
ShowSuccessful();
UpdateColumn("", lid, 1);
}
else
{
failed++;
ShowFailed();
UpdateColumn("", lid, 0);
}
var total = failed + success;
UpdateTotalCounter(total);
}
I did some testing and I can see that :
Invoke(new Action(() => UpdateColumn(stateInformation, cid, status)));
is failing. Can you please help me ?