ciao,
anzitutto grazie x la risp.
ma è davvero la tua? cioè lai fatta tu ?
mi spiegheresti questo passaggio ?
codice:
#region sms non letti
private void button2_Click(object sender, EventArgs e)
{
this.listBox2.Items.Clear();
System.Threading.Thread t = new System.Threading.Thread(RunThread_button2);
t.Start();
}
void RunThread_button2()
{
this.switchBoard.Enqueue
(
SwitchBoard.GetCommandReadSMS
(
SwitchBoard.SMSFolder.Unread,
new ATC_SMS.SMSReceivedEventHandler(Logicall_NotReadSMS_Received)
),
this.portInUse
);
}
void NotReadSMS_Received(object sender, SMS result)
{
this.listBox2.Items.Add("Numero destinatario : " + result.PhoneNumber);
this.listBox2.Items.Add("Testo : " + result.Message);
this.listBox2.Items.Add("-------------------");
}
void Logicall_NotReadSMS_Received(object sender, SMS result)
{
if (this.InvokeRequired)
{
ATC_SMS.SMSReceivedEventHandler d = new ATC_SMS.SMSReceivedEventHandler(NotReadSMS_Received);
this.Invoke(d, sender, result);
}
else
{
NotReadSMS_Received(sender, result);
}
}
#endregion