IT民工系列——c#控制短信猫 发送短信

 

前言:

我是一名IT民工,热爱计算机 热爱软件。我从事.net平台开发也有几年了,专注c#。熟悉: ORM/RBAC/AOP/OO/持久层/数据流/工作流/信息流/企业系统开发/Excel等解密等。


我过去几年直到现在的技术积累,希望能帮上各位兄弟。如果各位兄弟看上眼,一元钱用淘宝拍下;在淘宝商品备注留下email和项目的名字;我会邮寄给您代码源码密码和说明文档。

一元钱不多,希望能节省您的开发时间,也支持鼓励下我。如果兄弟收到了源码,也请保存好,不要放在互联网上,留小弟一条小小路走。我的淘宝用户是:pixysoft ,请确认,不要被恶意者冒用。


如果各位兄弟有小项目或者小想法,不想自己费神,我也愿意毛遂自荐承担一下,价格你开,只要我能做的就一定答应帮您做好!


我在此鞠躬感谢了!

 

代码目的:

c#操作短信猫,然后随意发送短信,当然要你的手机卡够钱。

这个是我曾经一个项目帮助一个公司制作官方手机短信平台。很多人会使用第三方免费提供的接口发短信,但是实在不方便。如果和移动签约,每个月就几万没有了,小公司还没到那个时候。所以选择短信猫。

注意,项目里面有个sms.dll是个关键,需要放在运行的目录下。

如果各位需要短信猫,我也能帮忙联系。谢谢!

代码测试片段:

 

 

Code
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Pixysoft.Cellphone;

namespace Pixysoft.Iter.Cellphone
{
    
public partial class Form1 : Form
    {
        
public Form1()
        {
            InitializeComponent();
        }

        
private void button1_Click(object sender, EventArgs e)
        {
            
string cellphonetype = "";

            
uint smsport = 4;

            
//安装软件猫之后,在 我的电脑-属性-硬件-设备管理器-端口(COM和LPT)出现 Prolific USB-to_serial Comm port(com4)

            
//这个COM4就是启动软件猫的端口号

            CellphoneHelper.Connect(smsport, 
out cellphonetype);

            label1.Text 
= cellphonetype;
        }

        
private void button2_Click(object sender, EventArgs e)
        {
            CellphoneHelper.DisConnect();
        }

        
private void button3_Click(object sender, EventArgs e)
        {
            
string no = textBox_no.Text;

            
string text = textBox1.Text;

            CellphoneHelper.Send(no, text);
        }
    }
}

 

 接口说明:


连接短信猫,连接成功,type会显示连接信息
public static bool Connect(uint port, uint baudrate, out string type)

连接短信猫
public static bool Connect(uint port, out string type)

关闭短信猫
public static void DisConnect()

发送短信
public static bool Send(string phoneNum, string content)

获取短信
public static List<SmsMessage> Receive()

删除短信
public static void Delete(string msgIndex)


代码源码下载(box.net提供空间 绝对安全放心):

http://www.citi-box.com/accessories/temp/Pixysoft.Iter.Cellphone.rar

代码资助链接(淘宝):

http://item.taobao.com/auction/item_detail.jhtml?item_id=86e39a36348da8663d647a9cce75d29c&x_id=0db2#

 

posted @ 2009-06-26 23:45    阅读(3293)  评论(6编辑  收藏  举报
IT民工