⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form1.cs

📁 用C#编的sms源代码
💻 CS
📖 第 1 页 / 共 2 页
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

namespace SMSDemo
{
	/// <summary>
	/// Form1 的摘要说明。
	/// </summary>
	public class Form1 : System.Windows.Forms.Form
	{
		private System.Windows.Forms.GroupBox groupBox1;
		private System.Windows.Forms.Label label1;
		private System.Windows.Forms.Label label2;
		private System.Windows.Forms.Label label3;
		private System.Windows.Forms.Label label4;
		private System.Windows.Forms.ComboBox cboMobileType;
		private System.Windows.Forms.ComboBox cboRate;
		private System.Windows.Forms.ComboBox cboSMSPort;
		private System.Windows.Forms.Button cmdConnect;
		private System.Windows.Forms.Button cmdDisConnect;
		private System.Windows.Forms.GroupBox groupBox2;
		private System.Windows.Forms.Label label5;
		private System.Windows.Forms.Label label6;
		private System.Windows.Forms.GroupBox groupBox3;
		private System.Windows.Forms.TextBox txtCenterNo;
		private System.Windows.Forms.TextBox txtMobileNo;
		private System.Windows.Forms.ListBox lstMobileNo;
		private System.Windows.Forms.TextBox txtMsg;
		private System.Windows.Forms.TextBox txtInfo;
		private System.Windows.Forms.CheckBox chkChinese;
		private System.Windows.Forms.CheckBox chkNeedReport;
		private System.Windows.Forms.Button cmdSend;
		private System.Windows.Forms.Timer TimerSend;
		private AxTransoftSMSControl30.AxSMS axSMS;
		private System.ComponentModel.IContainer components;

		public Form1()
		{
			//
			// Windows 窗体设计器支持所必需的
			//
			InitializeComponent();

			//
			// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
			//
		}

		/// <summary>
		/// 清理所有正在使用的资源。
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if (components != null) 
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows 窗体设计器生成的代码
		/// <summary>
		/// 设计器支持所需的方法 - 不要使用代码编辑器修改
		/// 此方法的内容。
		/// </summary>
		private void InitializeComponent()
		{
			this.components = new System.ComponentModel.Container();
			System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form1));
			this.groupBox1 = new System.Windows.Forms.GroupBox();
			this.cmdDisConnect = new System.Windows.Forms.Button();
			this.cmdConnect = new System.Windows.Forms.Button();
			this.cboSMSPort = new System.Windows.Forms.ComboBox();
			this.txtCenterNo = new System.Windows.Forms.TextBox();
			this.cboRate = new System.Windows.Forms.ComboBox();
			this.cboMobileType = new System.Windows.Forms.ComboBox();
			this.label4 = new System.Windows.Forms.Label();
			this.label3 = new System.Windows.Forms.Label();
			this.label2 = new System.Windows.Forms.Label();
			this.label1 = new System.Windows.Forms.Label();
			this.groupBox2 = new System.Windows.Forms.GroupBox();
			this.cmdSend = new System.Windows.Forms.Button();
			this.chkNeedReport = new System.Windows.Forms.CheckBox();
			this.chkChinese = new System.Windows.Forms.CheckBox();
			this.txtMsg = new System.Windows.Forms.TextBox();
			this.label6 = new System.Windows.Forms.Label();
			this.lstMobileNo = new System.Windows.Forms.ListBox();
			this.txtMobileNo = new System.Windows.Forms.TextBox();
			this.label5 = new System.Windows.Forms.Label();
			this.groupBox3 = new System.Windows.Forms.GroupBox();
			this.txtInfo = new System.Windows.Forms.TextBox();
			this.TimerSend = new System.Windows.Forms.Timer(this.components);
			this.axSMS = new AxTransoftSMSControl30.AxSMS();
			
			this.groupBox1.SuspendLayout();
			this.groupBox2.SuspendLayout();
			this.groupBox3.SuspendLayout();
			((System.ComponentModel.ISupportInitialize)(this.axSMS)).BeginInit();
			this.SuspendLayout();
			// 
			// groupBox1
			// 
			this.groupBox1.Controls.Add(this.cmdDisConnect);
			this.groupBox1.Controls.Add(this.cmdConnect);
			this.groupBox1.Controls.Add(this.cboSMSPort);
			this.groupBox1.Controls.Add(this.txtCenterNo);
			this.groupBox1.Controls.Add(this.cboRate);
			this.groupBox1.Controls.Add(this.cboMobileType);
			this.groupBox1.Controls.Add(this.label4);
			this.groupBox1.Controls.Add(this.label3);
			this.groupBox1.Controls.Add(this.label2);
			this.groupBox1.Controls.Add(this.label1);
			this.groupBox1.Location = new System.Drawing.Point(0, 0);
			this.groupBox1.Name = "groupBox1";
			this.groupBox1.Size = new System.Drawing.Size(496, 72);
			this.groupBox1.TabIndex = 0;
			this.groupBox1.TabStop = false;
			this.groupBox1.Text = "设备连接";
			// 
			// cmdDisConnect
			// 
			this.cmdDisConnect.Location = new System.Drawing.Point(424, 44);
			this.cmdDisConnect.Name = "cmdDisConnect";
			this.cmdDisConnect.Size = new System.Drawing.Size(64, 20);
			this.cmdDisConnect.TabIndex = 10;
			this.cmdDisConnect.Text = "断开";
			this.cmdDisConnect.Click += new System.EventHandler(this.cmdDisConnect_Click);
			// 
			// cmdConnect
			// 
			this.cmdConnect.Location = new System.Drawing.Point(424, 20);
			this.cmdConnect.Name = "cmdConnect";
			this.cmdConnect.Size = new System.Drawing.Size(64, 20);
			this.cmdConnect.TabIndex = 9;
			this.cmdConnect.Text = "连接";
			this.cmdConnect.Click += new System.EventHandler(this.cmdConnect_Click);
			// 
			// cboSMSPort
			// 
			this.cboSMSPort.Items.AddRange(new object[] {
															"1",
															"2",
															"3",
															"4",
															"5",
															"6",
															"7",
															"8",
															"9",
															"10"});
			this.cboSMSPort.Location = new System.Drawing.Point(283, 48);
			this.cboSMSPort.Name = "cboSMSPort";
			this.cboSMSPort.Size = new System.Drawing.Size(128, 20);
			this.cboSMSPort.TabIndex = 7;
			this.cboSMSPort.Text = "comboBox3";
			// 
			// txtCenterNo
			// 
			this.txtCenterNo.Location = new System.Drawing.Point(89, 44);
			this.txtCenterNo.Name = "txtCenterNo";
			this.txtCenterNo.Size = new System.Drawing.Size(128, 21);
			this.txtCenterNo.TabIndex = 6;
			this.txtCenterNo.Text = "8613800100500";
			// 
			// cboRate
			// 
			this.cboRate.Items.AddRange(new object[] {
														 "9600,n,8,1",
														 "19200,n,8,1",
														 "38400,n,8,1",
														 "57600,n,8,1",
														 "115200,n,8,1"});
			this.cboRate.Location = new System.Drawing.Point(283, 20);
			this.cboRate.Name = "cboRate";
			this.cboRate.Size = new System.Drawing.Size(128, 20);
			this.cboRate.TabIndex = 5;
			this.cboRate.Text = "comboBox2";
			// 
			// cboMobileType
			// 
			this.cboMobileType.Items.AddRange(new object[] {
															   "标准手机",
															   "Wavecom模块",
															   "Nokia手机",
															   "西门子手机"});
			this.cboMobileType.Location = new System.Drawing.Point(89, 16);
			this.cboMobileType.Name = "cboMobileType";
			this.cboMobileType.Size = new System.Drawing.Size(128, 20);
			this.cboMobileType.TabIndex = 4;
			this.cboMobileType.Text = "comboBox1";
			// 
			// label4
			// 
			this.label4.Location = new System.Drawing.Point(227, 48);
			this.label4.Name = "label4";
			this.label4.Size = new System.Drawing.Size(56, 16);
			this.label4.TabIndex = 3;
			this.label4.Text = "串口选择";
			// 
			// label3
			// 
			this.label3.Location = new System.Drawing.Point(8, 44);
			this.label3.Name = "label3";
			this.label3.Size = new System.Drawing.Size(88, 16);
			this.label3.TabIndex = 2;
			this.label3.Text = "短信中心号码";
			// 
			// label2
			// 
			this.label2.Location = new System.Drawing.Point(227, 20);
			this.label2.Name = "label2";
			this.label2.Size = new System.Drawing.Size(56, 16);
			this.label2.TabIndex = 1;
			this.label2.Text = "速率选择";
			// 
			// label1
			// 
			this.label1.Location = new System.Drawing.Point(35, 20);
			this.label1.Name = "label1";
			this.label1.Size = new System.Drawing.Size(56, 16);
			this.label1.TabIndex = 0;
			this.label1.Text = "设备类型";
			// 
			// groupBox2
			// 
			this.groupBox2.Controls.Add(this.cmdSend);
			this.groupBox2.Controls.Add(this.chkNeedReport);
			this.groupBox2.Controls.Add(this.chkChinese);
			this.groupBox2.Controls.Add(this.txtMsg);
			this.groupBox2.Controls.Add(this.label6);
			this.groupBox2.Controls.Add(this.lstMobileNo);
			this.groupBox2.Controls.Add(this.txtMobileNo);
			this.groupBox2.Controls.Add(this.label5);
			this.groupBox2.Location = new System.Drawing.Point(0, 76);
			this.groupBox2.Name = "groupBox2";
			this.groupBox2.Size = new System.Drawing.Size(496, 140);
			this.groupBox2.TabIndex = 1;
			this.groupBox2.TabStop = false;
			this.groupBox2.Text = "发短信";
			// 
			// cmdSend
			// 
			this.cmdSend.Location = new System.Drawing.Point(408, 112);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -