今年三月份,用VB,C#各写一份用手机+电脑+数据线发送短信的程式!感觉还行。 以下的功能单一,只能单发,或群发。只是初始的版本。朋友们可以看看其中的 一些技巧,如怎么将进值转换,中文转换,字符移位处理。用MSCOMM怎么发送和接收 数据,怎么延时等! using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; using System.Threading; namespace SendSMS { ///
/// Form1 的摘要说明。 /// public class FrmMain : System.Windows.Forms.Form { #region 控件的初始化===================================================== private System.Windows.Forms.GroupBox groupBox1; private System.Windows.Forms.ComboBox cboBox2; private System.Windows.Forms.ComboBox cboBox1; private System.Windows.Forms.Button btnCnn; private System.Windows.Forms.Label label2; private System.Windows.Forms.Label lbl; private System.Windows.Forms.Label lbls; private System.Windows.Forms.Button btnClose; private System.Windows.Forms.Label lblcnnInfo; private AxMSCommLib.AxMSComm MSCOMM; private System.Windows.Forms.GroupBox groupBox2; private System.Windows.Forms.Label lblCenter; private System.Windows.Forms.TextBox txtCenter; private System.Windows.Forms.Label lblVirtualDate; private System.Windows.Forms.Label lblMobile; private System.Windows.Forms.TextBox txtMobile; private System.Windows.Forms.Label label1; private System.Windows.Forms.StatusBar statusBar1; private System.Windows.Forms.StatusBarPanel statusBarPanel1; private System.Windows.Forms.StatusBarPanel statusBarPanel2; private System.Windows.Forms.StatusBarPanel statusBarPanel3; private System.Windows.Forms.Button btnSendSMS; private System.Windows.Forms.TextBox txtSMS; private System.Windows.Forms.ComboBox cboBox3; private System.Windows.Forms.Label lblSMS; private System.Windows.Forms.TextBox txtInput; ///
/// 必需的设计器变量。 /// private System.ComponentModel.Container components = null; public FrmMain() { // // Windows 窗体设计器支持所必需的 // InitializeComponent(); // // TOD 在 InitializeComponent 调用后添加任何构造函数代码 // } ///
/// 清理所有正在使用的资源。 /// protected override void Dispose( bool disposing ) { if( disposing ) { if (components != null) { components.Dispose(); } } base.Dispose( disposing ); } #region Windows Form Designer generated code ///
/// 设计器支持所需的方法 - 不要使用代码编辑器修改 /// 此方法的内容。 /// private void InitializeComponent() { System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(FrmMain)); this.groupBox1 = new System.Windows.Forms.GroupBox(); this.MSCOMM = new AxMSCommLib.AxMSComm(); this.lblcnnInfo = new System.Windows.Forms.Label(); this.btnClose = new System.Windows.Forms.Button(); this.cboBox2 = new System.Windows.Forms.ComboBox(); this.cboBox1 = new System.Windows.Forms.ComboBox(); this.btnCnn = new System.Windows.Forms.Button(); this.label2 = new System.Windows.Forms.Label(); this.lbl = new System.Windows.Forms.Label(); this.lbls = new System.Windows.Forms.Label(); this.groupBox2 = new System.Windows.Forms.GroupBox(); this.txtInput = new System.Windows.Forms.TextBox(); this.lblSMS = new System.Windows.Forms.Label(); this.cboBox3 = new System.Windows.Forms.ComboBox(); this.btnSendSMS = new System.Windows.Forms.Button(); this.txtSMS = new System.Windows.Forms.TextBox(); this.label1 = new System.Windows.Forms.Label(); this.txtMobile = new System.Windows.Forms.TextBox(); this.lblMobile = new System.Windows.Forms.Label(); this.lblVirtualDate =