当前位置PDU
  |  登录
 pdu.dll
最小化

移动风pdu.dll以动态链接库方式封装了gsm短信息pdu编解码的主要操作,方便用户进行gsm短信息开发。

1. delphi
type
  //短信PDU编码
  TSMS = record
    len: integer;
    pdu: string;
  end;
  PTSMS = ^TSMS;

function PDUEncode(content: PChar): PChar;stdcall;external 'pdu.dll';//中文编码转PDU格式
function PDUDecode(content: PChar): PChar;stdcall;external 'pdu.dll';//PDU解码
function EncodingSMS(center: PChar; phone: PChar; content: PChar;var sms: PTSMS): boolean;stdcall;external 'pdu.dll';//普通SMS编码
2. c#
        /// <summary>
        /// SMSpdu编码
        /// </summary>
        public struct TSMS
        {
            public int len;
            public string pdu;
        }

        [DllImport("pdu.dll ", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
        private static extern bool EncodingSMS(string center, string phone, string content, ref IntPtr sms);//普通SMS编码

        [DllImport("pdu.dll ", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
        private static extern string PDUEncode(string content);//中文编码转PDU格式

        [DllImport("pdu.dll ", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
        private static extern string PDUDecode(string content);//PDU解码

            IntPtr psms = new IntPtr();
            EncodingSMS(txtCenter.Text, txtPhone.Text, txtContent.Text, ref psms);
            TSMS sms = new TSMS();
            sms = (TSMS)Marshal.PtrToStructure(psms, typeof(TSMS));
            txtLen.Text = sms.len.ToString();
            txtPDU.Text = sms.pdu;
 

下载:pdu.dll

 pdu
最小化
短信息PDU编码测试
API bool EncodingSMS(string center, string phone, string content, ref IntPtr sms);//普通SMS编码
短消息中心地址
对方号码
短消息内容
剩余字数:  
点击按钮后,系统将生成pdu内容。
AT+CMGS=
>
长短信息PDU编码测试
API Delphi: function EncodingLongSMS2(center: PChar; phone: PChar; content: PChar): PChar;stdcall;
c#: string EncodingLongSMS2(string center, string phone, string content);//长短信息PDU编码