Gsmcomm.gsmcommunication.commexception ' произошло в gsmcommunication.dll
I'm using ASP.net to send SMS to mobile using GSM Device but unable to send message and getting this error GsmComm.GsmCommunication.CommException in GSMCommunication.dll Please suggest me how do i resolve this error. I have below code :
Что я уже пробовал:
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Data.SqlClient; using System.Text.RegularExpressions; using System.Runtime.Remoting.Channels; using System.Runtime.Remoting.Channels.Tcp; using GsmComm.PduConverter; using GsmComm.PduConverter.SmartMessaging; using GsmComm.GsmCommunication; using GsmComm.Interfaces; using GsmComm.Server; using System.Globalization; namespace GSMModem { public partial class Form1 : Form { private GsmCommMain comm; private delegate void SetTextCallback(string text); private SmsServer smsServer; public Form1() { InitializeComponent(); } TextBox txtMessage = new TextBox(); TextBox txtDonorName = new TextBox(); TextBox txtNumber = new TextBox(); TextBox txtDonorId = new TextBox(); private void btnExit_Click(object sender, EventArgs e) { Close(); } private void btnSend_Click(object sender, EventArgs e) { SmsSubmitPdu pdu; byte dcs = (byte)DataCodingScheme.GeneralCoding.Alpha7BitDefault; pdu = new SmsSubmitPdu("TESTING MESSAGE", "03325483575", dcs); comm.SendMessage(pdu); } private void Form1_Load(object sender, EventArgs e) { cmbCOM.Items.Add("COM1"); cmbCOM.Items.Add("COM2"); cmbCOM.Items.Add("COM3"); cmbCOM.Items.Add("COM4"); cmbCOM.Items.Add("COM5"); cmbCOM.Items.Add("COM6"); cmbCOM.Items.Add("COM7"); } private void btnConnect_Click(object sender, EventArgs e) { if (cmbCOM.Text == "") { MessageBox.Show("Invalid Port Name"); return; } comm = new GsmCommMain(cmbCOM.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("Modem Connected Sucessfully"); } catch (Exception) { Cursor.Current = Cursors.Default; if (MessageBox.Show(this, "GSM Modem is not available", "Check", MessageBoxButtons.RetryCancel, MessageBoxIcon.Warning) == DialogResult.Retry) retry = true; else { return;} } } while (retry); } } }