Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#
where to use dis code
public static Int16 Comm_Port = 0;
       public static Int32 Comm_BaudRate = 0;
       public static Int32 Comm_TimeOut = 0;
       public static GsmCommMain comm;
   }
please help...
i had included all the gsm comm lib in namespace
 
[Edit - added further code from OPs comment below CHill60]
private void button1_Click(object sender, EventArgs e)
        {
            GsmCommMain comm = new GsmCommMain("COM4", 19200, 300);
 
            try
            {
                comm.Open();
 
                string CELL_Number, SMS_Message;
 
                SmsSubmitPdu pdu1;
            
                if (comm.IsConnected() == true)
                {
                    if (number.Text.ToString() == "")
                    {
                        MessageBox.Show("Kindly Add Cell Number\r\n\nFor Example\n\n+9231234567", "Information", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        return;
                    }
                    else if (message.Text.ToString() == "")
                    {
                        MessageBox.Show("Kindly Add Your Message Text", "Information", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        return;
                    }
 
                    CELL_Number = number.Text.ToString();
                    SMS_Message = message.Text.ToString();
 
                    MessageBox.Show("Kindly Re-Check Your SMS & CELL NUMBER \r\n\nCELL # : " + CELL_Number + "\r\n\nMESSAGE TEXT : " + SMS_Message, "SMS INFO", MessageBoxButtons.OKCancel, MessageBoxIcon.Information);
 
                        Cursor.Current = Cursors.WaitCursor;
 
                        pdu1 = new SmsSubmitPdu(SMS_Message, CELL_Number, "");
 
                        comm.SendMessage(pdu1);
 
                        Cursor.Current = Cursors.Default;
 
                        MessageBox.Show("M E S S A G E - S E N T", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        comm.Close();
                }
            }
 
                    catch (Exception )
                    {
                        MessageBox.Show("Error Sending SMS To Destination Address\r\n\n Connection Has Been Terminated !!!\r\n\n", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        
                    }
                }
            }
           
        }
plz help me in sending message...
after the modem shows message box connected ...
the send button showing error plz help.
Posted 11-Feb-13 5:02am
Edited 15-Feb-13 6:03am
CHill6060.9K
v3
Comments
Sergey Alexandrovich Kryukov at 15-Feb-13 14:18pm
   
Please stop re-posting. Put all information in one page.
—SA

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

This looks remarkably similar to a code segment from this code project article[^]
If you read the article carefully and browse the code that is supplied (see the Browse Code link at the top left of the article) then your question will be answered in full
  Permalink  
Comments
pranavjeet at 15-Feb-13 6:30am
   
private void button1_Click(object sender, EventArgs e)
{
GsmCommMain comm = new GsmCommMain("COM4", 19200, 300);
 
try
{
comm.Open();
 
string CELL_Number, SMS_Message;
 
SmsSubmitPdu pdu1;


 

 
if (comm.IsConnected() == true)
{
if (number.Text.ToString() == "")
{
MessageBox.Show("Kindly Add Cell Number\r\n\nFor Example\n\n+9231234567", "Information", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
return;
}
else if (message.Text.ToString() == "")
{
MessageBox.Show("Kindly Add Your Message Text", "Information", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
return;
}
 
CELL_Number = number.Text.ToString();
SMS_Message = message.Text.ToString();
 
MessageBox.Show("Kindly Re-Check Your SMS & CELL NUMBER \r\n\nCELL # : " + CELL_Number + "\r\n\nMESSAGE TEXT : " + SMS_Message, "SMS INFO", MessageBoxButtons.OKCancel, MessageBoxIcon.Information);
 

Cursor.Current = Cursors.WaitCursor;
 
pdu1 = new SmsSubmitPdu(SMS_Message, CELL_Number, "");
 
comm.SendMessage(pdu1);
 
Cursor.Current = Cursors.Default;
 
MessageBox.Show("M E S S A G E - S E N T", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
comm.Close();
}
}
 
catch (Exception )
{
MessageBox.Show("Error Sending SMS To Destination Address\r\n\n Connection Has Been Terminated !!!\r\n\n", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);

}
}
}

}

plz help me in sending message...
after the modem shows message box connected ...
the send button showing error plz help.
its urgent
CHill60 at 15-Feb-13 12:05pm
   
If you mean the MessageBox.Show in the catch(Exception) block is shown then try including the Exception.Message in the text so you can see what the error is

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 210
1 Richard MacCutchan 100
2 kbrandwijk 90
3 ProgramFOX 80
4 Sandeep Singh Shekhawat 70
0 Sergey Alexandrovich Kryukov 9,050
1 OriginalGriff 8,151
2 CPallini 2,613
3 Richard MacCutchan 2,221
4 Abhinav S 1,928


Advertise | Privacy | Mobile
Web03 | 2.8.140827.1 | Last Updated 15 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100