如题,怎么实现(程序)?
要配备哪些设备?
要和哪些部门联系?估计移动、联通、电信的不一样,我只接触过短信猫,其他什么也不知道。
开发过这种软件的指点下。
要配备哪些设备?
要和哪些部门联系?估计移动、联通、电信的不一样,我只接触过短信猫,其他什么也不知道。
开发过这种软件的指点下。
解决方案 »
- 关于GDI+中Rectangle的不解问题?
- 到底谁可以帮我解决c#中的接口问题
- c#中static干什么用的?
- 异常
- 为什么很多人都说用c#写的程序的性能会比其他的差,比如大部分人说java写的要被c#的性能好
- 如何妨止程序在 Vista 下因 UAC的原因,在运行时老是弹出那个安全对话框?
- 重写一定要声明为virtual吗?
- 求助:c#编写的应用程序运行时要安装Microsoft .NET Framework SDK 吗?
- 求救!!c#pop3收邮件解码问题
- 为什么不能using其它目录中类文件的namespace?
- 如何计算当前时间是本月份的第几个周几?
- 这个Lambda表达式怎么没有输出内容呢
http://www.emay.cn/product/duanxin/p_493.htm
http://www.duanxin110.cn/download/sdk.pdf
这个解决不了吗?
遇到什么问题?闲暇时光不想浪费吗?用《Csdn收音机》找个话题聊聊技术吧!
可以做飞信的二次开发,下载个SDK玩玩,很简单.不过有一些限制.
通过网关可以发送,向移动或者联通购买服务,使用tcp或udp连接到指定指定网关可以发送.需要了解一些tcp/ip方面的知识,需要花点时间研究移动或者联通的相关协议,例如CPMM或者SGIP
2.找运商申请SP(短信网关)账号,然后开发SP接口程序。接口协议复杂,开发实现难度大些
3.找中间商约定接口。API通常经过简化,开发实现难度通常比较小
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.OleDb;namespace WindowsApplication2
{
public partial class Form1 : Form
{
bool IsMessageFlag=false;
string MessageStr,MessageLth;
int j=0;
string msg = "";//要发送的消息内容,
string num = "";//对方手机号码
string csca = "8613800210500";//短消息中心号码,具体请查询SIM卡,这个是上海移动的号码 string prex = "0891";
string midx = "11000D91";
string sufx = "000800"; public Form1()
{
InitializeComponent();
} private void encode()
{
/*pdu编码,计算长度*/
string pdu, psmsc, pnum, pmsg;
string leng;
int length;
length = (msg.Length) * 2;
leng = length.ToString("X");
if (length < 16)
{
leng = "0" + leng;
}
psmsc = telc(csca).Trim();
pnum = telc(num).Trim();
pmsg = ascg(msg.Trim());
pdu = prex + psmsc + midx + pnum + sufx + leng + pmsg;
MessageStr = pdu;
MessageLth = (15 + length).ToString();
} private string telc(string MobileNum)
{
/*手机号码转换*/
int tl;
string ltem, rtem, ttem;
int ti; ttem = "";
tl = MobileNum.Trim().Length;
if (tl != 11 && tl != 13)
{
MessageBox.Show("wrong number:" + MobileNum);
return "";
}
if (tl == 11)
{
tl += 2;
MobileNum = "86" + MobileNum;
}
for (ti = 0; ti < tl; ti += 2)
{
ltem = MobileNum.Substring(ti, 1);
if (ti == tl - 1)
{
rtem = "F";
}
else
{
rtem = MobileNum.Substring(ti + 1, 1);
}
ttem += rtem + ltem;
}
return ttem;
} private string ascg(string smsg)
{
/*unicode编码转换*/
string res = "";
string ls;
string rs; byte[] resByte = System.Text.UnicodeEncoding.Unicode.GetBytes(smsg);
for (int i = 0; i < resByte.Length; i += 2)
{
ls = resByte[i].ToString("X2");
rs = resByte[i + 1].ToString("X2");
res = res + rs + ls;
}
return res.Trim();
} private void co(string cos)
{
/*下发指令*/
try
{
serialPort1.Open();
byte[] WriteBuffer = Encoding.ASCII.GetBytes(cos);
serialPort1.Write(WriteBuffer, 0, WriteBuffer.Length);
while (IsMessageFlag == false) ;
IsMessageFlag = false;
System.Threading.Thread.Sleep(1000);
serialPort1.Close();
}
catch {MessageBox.Show("no gsm");}
} private void cco()
{
/*状态归零*/
IsMessageFlag = false;
j = 0;
} private void serialPort1_DataReceived(object sender, System.IO.Ports.SerialDataReceivedEventArgs e)
{
/*获取GSM反馈信息*/
CheckForIllegalCrossThreadCalls = false; StringBuilder currentline = new StringBuilder();
j++;
while (serialPort1.BytesToRead > 0)
{
char ch = (char)serialPort1.ReadByte();
currentline.Append(ch);
}
IsMessageFlag = true;
textBox2.Text = currentline.ToString();
}
private void button4_Click(object sender, EventArgs e)
{
/*发短信*/
encode();
string s1 = "AT" + "\r";
string s2 = "AT+CMGF=0" + "\r";
string s3 = "AT+CMGS=" + MessageLth + "\r";
string s4 = MessageStr + ((char)26).ToString();
co(s1);
cco();
co(s2);
cco();
co(s3);
cco();
co(s4);
cco();
}
}
}
你可以去这里下载http://www.infotoall.com/message/soft-download.htm