I have a Windows Form in my project. This form contains 3 controls: txtUss
, btnCheck
and txtMessage
. The scenario is that after a "ussd" command has been entered in the txtUss
text box and the btnCheck
button has been pressed, the result will displayed in txtMessage
.
here is the detail of my winform https://www.dropbox.com/s/2lo8ci3rcoznvlh/ussd.PNG
btnCheck Code :
private void btnCheck_Click(object sender, EventArgs e)
{
try
{
SerialPort port = new SerialPort();
port.BaudRate = 115200;
port.PortName = "COM3";
port.Timeout = 300;
port.Open();
port.Write("AT+CUSD=1," + txtUssd.Text + ",15");
txtMessage.text = ; // <<< here is the result.
// but i dont know how to refer port.Write("AT+CUSD=1," + txtUssd.Text + ",15");
port.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
I don't know how to get the result in the txtMessage
text box.
Any one can suggest me or give some example...?
if you wanna get update solve for this question and topic checking balance in modem, follow this link : Check balance using USSD Command in C#