如何解决这个错误“GsmComm.GsmCommunication.CommException”? [英] How can solve this error "GsmComm.GsmCommunication.CommException "?

查看:75
本文介绍了如何解决这个错误“GsmComm.GsmCommunication.CommException”?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在使用C#窗口应用程序进行SMS简单项目。我使用GSM调制解调器设备发送消息。首先我选择调制解调器端口并且连接成功完成但是当我尝试发送短信时,

我收到错误(GsmComm.GsmCommunication.CommException)。

//代码

操作代码=新操作();

尝试

{

txtNumber.Text =0973118993;

Cursor.Current = Cursors.WaitCursor;

txtMessage.Text =尊重+ txtDonorName.Text +,欢迎致Clapp Trust。您的捐赠者ID是+ txtDonorId.Text +。我们的在线系统会在您收到捐款时向您发送短信。;

尝试

{

SmsSubmitPdu pdu;

byte dcs =(byte)DataCodingScheme.GeneralCoding.Alpha7BitDefault;

pdu = ne w SmsSubmitPdu(txtMessage.Text,Convert.ToString(txtNumber.Text),dcs);



int times = 1;

for( int i = 0;我<倍; i ++)

{

comm.SendMessage(pdu);

}

}

catch(Exception ex)

{

MessageBox.Show(调制解调器不可用);



}

}

catch

{

MessageBox.Show(短信不发送);

}

有什么问题?

Hi All,
I was doing SMS simple project with C# window application . I used GSM modem device to send message.Firstly I chose modem port and the connection was done successfully but when I tried to send a SMS ,
I got error " (GsmComm.GsmCommunication.CommException)" .
//Code
Operation code = new Operation();
try
{
txtNumber.Text = "0973118993";
Cursor.Current = Cursors.WaitCursor;
txtMessage.Text = "Respected " + txtDonorName.Text + ", Welcome to Clapp Trust. Your donor ID is " + txtDonorId.Text + ". Our online system will send you SMS whenever your donation is received.";
try
{
SmsSubmitPdu pdu;
byte dcs = (byte)DataCodingScheme.GeneralCoding.Alpha7BitDefault;
pdu = new SmsSubmitPdu(txtMessage.Text, Convert.ToString(txtNumber.Text), dcs );

int times = 1;
for (int i = 0; i < times; i++)
{
comm.SendMessage(pdu);
}
}
catch (Exception ex)
{
MessageBox.Show("Modem is not available");

}
}
catch
{
MessageBox.Show("SMS not send");
}
What's the problem?

推荐答案

GsmComm DLL的github页面(GsmCommunication.CommException)< a href =https://github.com/welly87/GSMComm/blob/master/GSMCommShared/GsmCommunication/CommException.cs> https://github.com/welly87/GSMComm/blob/master/GSMCommShared/GsmCommunication/CommException .cs [ ^ ]表明异常应该返回更多信息。 />


也许这会有所帮助



'g'
the github page for the GsmComm DLL (GsmCommunication.CommException) https://github.com/welly87/GSMComm/blob/master/GSMCommShared/GsmCommunication/CommException.cs[^] suggests there is more information that should be returned by the exception

Maybe that will help

'g'


这篇关于如何解决这个错误“GsmComm.GsmCommunication.CommException”?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆