Possible Duplicate:
Use of var keyword in C#
What is the benefit of using
varfor initializing an object as in the first line of following code,var spis used for SerialPort.What is the benefit of disposing an object after using it? As in following code, the object
SerialPortis disposed after an SMS has been sent to the recipient.
Code:
using (var sp = new SerialPort(cbcomport.Text))
{
    sp.Open();
    sp.WriteLine("AT" + Environment.NewLine);
    sp.WriteLine("AT+CMGF=1" + Environment.NewLine);
    sp.WriteLine("AT+CMGS=\"" + dt.Rows[i]["PhoneNo"] + "\"" + Environment.NewLine);
    sp.WriteLine(tbsms.Text + (char)26);
    Thread.Sleep(5000);
}