📄 form1.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Text;
using System.Runtime.InteropServices;
namespace sendmessage
{
/// <summary>
/// Form1 的摘要说明。
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.GroupBox groupBox3;
private System.Windows.Forms.GroupBox groupBox4;
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.Label label5;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.TextBox server;
private System.Windows.Forms.TextBox customID;
private System.Windows.Forms.TextBox userName;
private System.Windows.Forms.TextBox passWord;
private System.Windows.Forms.Button conntion;
private System.Windows.Forms.Button close;
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;
private System.Windows.Forms.Button send;
private System.Windows.Forms.Button sendEx;
private System.Windows.Forms.TextBox message;
private System.Windows.Forms.TextBox tel;
private System.Windows.Forms.Button btnState;
private System.Windows.Forms.TextBox txtState;
private System.Windows.Forms.Button count;
private System.Windows.Forms.Button receive;
private bool connState=false;//标志当前的连接状态
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.groupBox1 = new System.Windows.Forms.GroupBox();
this.passWord = new System.Windows.Forms.TextBox();
this.userName = new System.Windows.Forms.TextBox();
this.customID = new System.Windows.Forms.TextBox();
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.server = new System.Windows.Forms.TextBox();
this.conntion = new System.Windows.Forms.Button();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.sendEx = new System.Windows.Forms.Button();
this.send = new System.Windows.Forms.Button();
this.message = new System.Windows.Forms.TextBox();
this.tel = new System.Windows.Forms.TextBox();
this.label6 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.count = new System.Windows.Forms.Button();
this.receive = new System.Windows.Forms.Button();
this.groupBox4 = new System.Windows.Forms.GroupBox();
this.btnState = new System.Windows.Forms.Button();
this.txtState = new System.Windows.Forms.TextBox();
this.close = new System.Windows.Forms.Button();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.groupBox3.SuspendLayout();
this.groupBox4.SuspendLayout();
this.SuspendLayout();
//
// groupBox1
//
this.groupBox1.Controls.Add(this.passWord);
this.groupBox1.Controls.Add(this.userName);
this.groupBox1.Controls.Add(this.customID);
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.Controls.Add(this.server);
this.groupBox1.Controls.Add(this.conntion);
this.groupBox1.Location = new System.Drawing.Point(288, 8);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(208, 240);
this.groupBox1.TabIndex = 0;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "连接设置";
//
// passWord
//
this.passWord.Location = new System.Drawing.Point(80, 120);
this.passWord.Name = "passWord";
this.passWord.PasswordChar = '*';
this.passWord.TabIndex = 6;
this.passWord.Text = "";
//
// userName
//
this.userName.Location = new System.Drawing.Point(80, 96);
this.userName.Name = "userName";
this.userName.TabIndex = 5;
this.userName.Text = "Admin";
//
// customID
//
this.customID.Location = new System.Drawing.Point(80, 64);
this.customID.Name = "customID";
this.customID.TabIndex = 4;
this.customID.Text = "100000";
//
// label4
//
this.label4.Location = new System.Drawing.Point(16, 128);
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(16, 96);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(56, 16);
this.label3.TabIndex = 2;
this.label3.Text = "帐号:";
//
// label2
//
this.label2.Location = new System.Drawing.Point(16, 64);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(56, 16);
this.label2.TabIndex = 1;
this.label2.Text = "企业ID:";
//
// label1
//
this.label1.Location = new System.Drawing.Point(16, 32);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(56, 16);
this.label1.TabIndex = 0;
this.label1.Text = "服务器:";
//
// server
//
this.server.Location = new System.Drawing.Point(80, 32);
this.server.Name = "server";
this.server.TabIndex = 0;
this.server.Text = "www.mobset.com";
//
// conntion
//
this.conntion.Location = new System.Drawing.Point(64, 192);
this.conntion.Name = "conntion";
this.conntion.Size = new System.Drawing.Size(72, 23);
this.conntion.TabIndex = 0;
this.conntion.Text = "连 接";
this.conntion.Click += new System.EventHandler(this.conntion_Click);
//
// groupBox2
//
this.groupBox2.Controls.Add(this.sendEx);
this.groupBox2.Controls.Add(this.send);
this.groupBox2.Controls.Add(this.message);
this.groupBox2.Controls.Add(this.tel);
this.groupBox2.Controls.Add(this.label6);
this.groupBox2.Controls.Add(this.label5);
this.groupBox2.Location = new System.Drawing.Point(8, 8);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(264, 216);
this.groupBox2.TabIndex = 1;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "短信发送";
//
// sendEx
//
this.sendEx.Location = new System.Drawing.Point(136, 176);
this.sendEx.Name = "sendEx";
this.sendEx.Size = new System.Drawing.Size(96, 24);
this.sendEx.TabIndex = 10;
this.sendEx.Text = "sendEx";
this.sendEx.Click += new System.EventHandler(this.sendEx_Click);
//
// send
//
this.send.Location = new System.Drawing.Point(24, 176);
this.send.Name = "send";
this.send.Size = new System.Drawing.Size(96, 24);
this.send.TabIndex = 9;
this.send.Text = "发送短信";
this.send.Click += new System.EventHandler(this.send_Click);
//
// message
//
this.message.Location = new System.Drawing.Point(64, 64);
this.message.Multiline = true;
this.message.Name = "message";
this.message.ScrollBars = System.Windows.Forms.ScrollBars.Horizontal;
this.message.Size = new System.Drawing.Size(184, 96);
this.message.TabIndex = 8;
this.message.Text = "";
//
// tel
//
this.tel.Location = new System.Drawing.Point(64, 32);
this.tel.Name = "tel";
this.tel.Size = new System.Drawing.Size(184, 21);
this.tel.TabIndex = 7;
this.tel.Text = "";
//
// label6
//
this.label6.Location = new System.Drawing.Point(8, 56);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(56, 16);
this.label6.TabIndex = 5;
this.label6.Text = "内容:";
//
// label5
//
this.label5.Location = new System.Drawing.Point(8, 32);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(56, 16);
this.label5.TabIndex = 4;
this.label5.Text = "号码:";
//
// groupBox3
//
this.groupBox3.Controls.Add(this.count);
this.groupBox3.Controls.Add(this.receive);
this.groupBox3.Location = new System.Drawing.Point(8, 296);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(264, 56);
this.groupBox3.TabIndex = 1;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "其他操作";
//
// count
//
this.count.Location = new System.Drawing.Point(144, 24);
this.count.Name = "count";
this.count.Size = new System.Drawing.Size(112, 24);
this.count.TabIndex = 13;
this.count.Text = "取剩余的短信量";
this.count.Click += new System.EventHandler(this.count_Click);
//
// receive
//
this.receive.Location = new System.Drawing.Point(8, 24);
this.receive.Name = "receive";
this.receive.Size = new System.Drawing.Size(112, 24);
this.receive.TabIndex = 12;
this.receive.Text = "取接受到的短信";
this.receive.Click += new System.EventHandler(this.receive_Click);
//
// groupBox4
//
this.groupBox4.Controls.Add(this.btnState);
this.groupBox4.Controls.Add(this.txtState);
this.groupBox4.Location = new System.Drawing.Point(8, 232);
this.groupBox4.Name = "groupBox4";
this.groupBox4.Size = new System.Drawing.Size(264, 56);
this.groupBox4.TabIndex = 1;
this.groupBox4.TabStop = false;
this.groupBox4.Text = "短信状态";
//
// btnState
//
this.btnState.Location = new System.Drawing.Point(168, 16);
this.btnState.Name = "btnState";
this.btnState.Size = new System.Drawing.Size(80, 24);
this.btnState.TabIndex = 11;
this.btnState.Text = "获取状态";
this.btnState.Click += new System.EventHandler(this.btnState_Click);
//
// txtState
//
this.txtState.Location = new System.Drawing.Point(16, 18);
this.txtState.Name = "txtState";
this.txtState.Size = new System.Drawing.Size(136, 21);
this.txtState.TabIndex = 7;
this.txtState.Text = "";
//
// close
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -