找传奇、传世资源到传世资源站!

C# 短信猫 发短信例子源码

8.5玩家评分(1人评分)
下载后可评
介绍 评论 失效链接反馈

C# 短信猫 发短信例子源码 C#语言基础-第1张using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using GSMMODEM;namespace 测试{ public partial class Form1 : Form { public Form1() { InitializeComponent(); } GSMModem gm = new GSMModem("COM3", 9600); private void button1_Click(object sender, EventArgs e) { try { gm.SendMsg(textBox3.Text, textBox4.Text); } catch (Exception ex) { textBox4.Text = ex.Message; return; } textBox4.Text = "发送成功"; } private void textBox1_TextChanged(object sender, EventArgs e) { } private void Form1_Load(object sender, EventArgs e) { gm.Open(); gm.SendAT("ATE0"); gm.OnRecieved = new GSMModem.OnRecievedHandler(gm_OnRecieved); } void gm_OnRecieved(object sender, EventArgs e) { string s1, s2, s3, s4; gm.ReadMsgByIndex(gm.NewMsgIndex, out s1, out s2, out s3, out s4); textBox1.Text = s1 s2 s3 s4; //此处引发异常(此处不属于主进程) 须回调函数才能改变此属性 } private void button2_Click(object sender, EventArgs e) { string s1, s2, s3, s4;gm.ReadMsgByIndex(2,out s1,out s2,out s3,out s4); textBox1.Text = s1 s2 s3 s4; /*try { gm.DeleteMsgByIndex(1); } catch (Exception ex) { textBox1.Text = ex.Message; return; } textBox1.Text = "删除成功";*/ } }}

评论

发表评论必须先登陆, 您可以 登陆 或者 注册新账号 !


在线咨询: 问题反馈
客服QQ:174666394

有问题请留言,看到后及时答复