Good morning everyone, I am starting to implement threads in a program created in VisualStudio (windows form) and whenever I start my program the antivirus is activated putting my program in the quarantine. I'm going to post leave my code here to show how I did my implementation.
public partial class Form1 : Form{
public Thread th;
private void Form1_Load(object sender, EventArgs e)
{
th = new Thread(new ThreadStart(this.TimerPings));
th.Start();
}
private void TimerPings()
{
timer = new System.Threading.Timer(new TimerCallback(VerificaStatusEquipamentos), null, 1000, 10000);
}
public void VerificaStatusEquipamentos(object state)
{
//este método ficou um pouco extenso, mas o que ele faz é
//uma rotina foreach em uma lista e altera o .Text de alguns
//labels do meu Form principal
}
}
}
Does anyone know what could cause this antivirus activation? Is this implementation of thread usage correct or would I have to implement it in another way? I used this post as an example ( insert the link description here ) and another tutorial to implement Timer . Thanks in advance to anyone who can help, give some tips.