TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Nadun Jayathilaka
NA
8
786
C# application to send SMS
Jan 5 2016 8:38 PM
Please can anyone find the error in this code.
Connecting to the port is OK, but the SMS doesn't send.
//Connecting to port
//__________________________________________________________________________________________________________________________
private void button1_Click_1(object sender, EventArgs e)
{
if (txtComPort.Text == "")
{
MessageBox.Show("Invalid port number");
return;
}
comm = new GsmCommMain(txtComPort.Text, 9600, 150);
Cursor.Current = Cursors.Default;
bool retry;
do
{
retry = false;
try{
Cursor.Current = Cursors.WaitCursor;
comm.Open();
Cursor.Current=Cursors.Default;
MessageBox.Show("Connected");
}catch(Exception)
{
Cursor.Current=Cursors.Default;
if(MessageBox.Show(this,"GSM is not available","Check",MessageBoxButtons.RetryCancel,MessageBoxIcon.Warning)==DialogResult.Retry);
}
}
while(retry);
}
//Send SMS
//__________________________________________________________________________________________________________________________
try
{
SmsSubmitPdu pdu;
byte dcs = (byte)DataCodingScheme.GeneralCoding.Alpha7BitDefault;
pdu = new SmsSubmitPdu(txtSMS.Text, txtRecoverTel.Text,dcs);
int time = 1;
for (int i = 0; i < time; i++)
{
comm.SendMessage(pdu);
}
}
catch(Exception)
{
MessageBox.Show("Not availale");
}
Reply
Answers (
3
)
Using get_range for excel
How to give margins to existing word document