欢迎来到传世资源网!
加载中...
正在加载,请耐心等待...
本站为收藏、学习站,如有侵权,请联系管理员删除!

C#短信猫二次开发(收短信/发短信)示例源码

介绍 评论 失效链接反馈

from clipboard
from clipboard
using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using System.Runtime.InteropServices;using System.IO.Ports;namespace SmsServer{ public partial class Form1 : Form { [DllImport("GSM.dll")] public static extern int LinkModem(int iPort); [DllImport("GSM.dll")] public static extern int CloseModem(); [DllImport("GSM.dll")] public static extern int CheckModem(); [DllImport("GSM.dll")] public static extern string GetService(); [DllImport("GSM.dll")] public static extern int SendSMS(String smsCenter, String phone, String msg); [DllImport("GSM.dll")] public static extern int NewMessageToWhere(int iSaveType); [DllImport("GSM.dll")] public static extern string GetNewMessage(); [DllImport("GSM.dll")] public static extern string GetMessage(int Index); [DllImport("GSM.dll")] public static extern int DeleteSMSByNo(int Index); [DllImport("GSM.dll")] public static extern int DeleteAllSMS(); [DllImport("GSM.dll")] public static extern string myTest(); public Form1() { InitializeComponent(); } private void 连接设备ToolStripMenuItem_Click(object sender, EventArgs e) { if (this.comboBox1.Text.Trim() != "") { if (LinkModem(int.Parse(comboBox1.Text.Trim().Substring(3,1))) > 0) MessageBox.Show("连接设备成功!"); else MessageBox.Show("连接设备失败!"); } else MessageBox.Show("请先选择串口号!"); } private void toolStripMenuItem1_Click(object sender, EventArgs e) { panel2.Visible = true; panel2.Dock = DockStyle.Fill; foreach (string vPortName in SerialPort.GetPortNames()) { this.comboBox1.Items.Add(vPortName); } } private void 发送短信ToolStripMenuItem_Click(object sender, EventArgs e) { string Service = GetService(); MessageBox.Show(Service); } }}

下载声明:

本站资源均有第三方用户自行上传分享推荐,非本站自制,仅供玩家做交流学习之用!切勿用于商业用途!游戏作品版权归原作者享有,如有版权问题,请附带版权证明至邮件,本平台将应您的要求删除。
相关推荐:

评论

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


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

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