如何使用gsm moden发送短信 [英] How to send sms using gsm moden

查看:55
本文介绍了如何使用gsm moden发送短信的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用 gsm moden d发送 400 个字符短信链接dwn  157  c#如果错误然后重复发送





我尝试了什么:



我想使用gsm moden d link发送400个字符的短信dwn 157 c#if err then repeat send

解决方案

你可以使用这个(GSMCOMM)库,请考虑发送长消息,你必须创建多个pdu消息这个链接,请下载它,包中包含足以解决您问题的样本和信息

它还支持GSM调制解调器。

SMS库(适用于GSM手机) [ ^ ]



示例

   #region MultipleMessaging 
private SmsSubmitPdu [] CreateConcatMessage( string 消息,字符串编号, bool unicode, bool showParts)
{
SmsSubmitPdu [] pdus = null ;
尝试
{
if (!unicode)
{

pdus = GsmComm.PduConverter.SmartMessaging.SmartMessageFactory.CreateConcatTextMessage(message,number);
}
else
{

pdus = GsmComm.PduConverter.SmartMessaging.SmartMessageFactory.CreateConcatTextMessage(message , true ,number);
}
}
catch (例外情况)
{
// MessageBox.Show(ex.ToString());
return null ;
}



return pdus;
}

private void SendMultiple(SmsSubmitPdu [] pdus)
{


尝试
{
// 发送已创建的消息

foreach (SmsSubmitPdu pdu in pdus)
{

mainComminucator.SendMessage(pdu);
}

}
catch (例外情况)
{
/// MessageBox.Show(ERROR+ ex.ToString());
}


}
#endregion


I want to send 400 character sms using gsm moden d link dwn 157 c# if err then repet send



What I have tried:

I want to send 400 character sms using gsm moden d link dwn 157 c# if err then repet send

解决方案

You can use this (GSMCOMM) library, please consider for sending long messages you have to create multiple pdu mesage this link, please download it, the packages contains sample and information enough for your problem
it support also GSM modems.
SMS libraries (for GSM phones)[^]

Sample

#region MultipleMessaging
private SmsSubmitPdu[] CreateConcatMessage(string message, string number, bool unicode, bool showParts)
{
    SmsSubmitPdu[] pdus = null;
    try
    {
        if (!unicode)
        {

            pdus = GsmComm.PduConverter.SmartMessaging.SmartMessageFactory.CreateConcatTextMessage(message, number);
        }
        else
        {

            pdus = GsmComm.PduConverter.SmartMessaging.SmartMessageFactory.CreateConcatTextMessage(message, true, number);
        }
    }
    catch (Exception ex)
    {
        //MessageBox.Show(ex.ToString());
        return null;
    }



    return pdus;
}

private void SendMultiple(SmsSubmitPdu[] pdus)
{


    try
    {
        // Send the created messages

        foreach (SmsSubmitPdu pdu in pdus)
        {

            mainComminucator.SendMessage(pdu);
        }

    }
    catch (Exception ex)
    {
        ///MessageBox.Show("ERROR" + ex.ToString());
    }


}
#endregion


这篇关于如何使用gsm moden发送短信的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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