The following information is for the Complementary Technologies
sms1.Open(textBox3.Text);
Opens the connection to the GSM modem.
bool Open(string Portnum)
Parameters
Portnum - The comm port number the GSM modem is connected to.
Return Value
true if open is successful otherwise false
sms1.Close();
Close the GSM modem connection.
void Close()
sms1.Query();
Used to identify the GSM modem. When the GSM replies, the onReceived event occurs and the identification string is assigned to the sresult property.
void Query()
sms1.Send(textBox1.Text, textBox2.Text);
The Send method is used to send an SMS to another phone. Two strings are passed, one for the message and the other for the phone number.
void Send(string smsg, string sphone)
Parameters
smsg - message string that is sent to the destination phone
sphone - string of the phone number of the destination phone
The message or status from the modem is returned as a string and assigned to the sresult property.
public string sresult {get;}
Property Value
string of the message or status
The event occurs when the modem receives an SMS message or reports a status or acknowledgement. The information is stored in the sresult property.
private void sms1_onReceived(object sender, EventArgs e)
{
Control.CheckForIllegalCrossThreadCalls = false;
label1.Text = sms1.sresult;
}
This CheckForIllegalCrossThreadCalls property is new in the .NET Framework version 2.0. Gets or sets a value indicating whether to catch calls on the wrong thread that access a control's Handle property. If left as default true, you will get the following runtime error.
"Cross-thread operation not valid: Control label1 accessed from a thread other than the thread it was created on."
Control.CheckForIllegalCrossThreadCalls = false;
Setting it false is a quick fix.