📄 xinduanxin.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
namespace ShInfo
{
/// <summary>
/// Xinduanxin 的摘要说明。
/// </summary>
public class Xinduanxin : System.Windows.Forms.Form
{
private System.Windows.Forms.RichTextBox richTextBox1;
private System.Windows.Forms.Label lblPhone;
private System.Windows.Forms.TextBox txtPhone;
private System.Windows.Forms.Button btnFasong;
private System.Windows.Forms.Button btnExit2;
private Sunisoft.IrisSkin.SkinEngine skinEngine1;
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;
public static ShortMessage SM=new ShortMessage();
public Xinduanxin()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
this.skinEngine1.SkinFile = "Page.ssk";
//
// 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()
{
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Xinduanxin));
this.skinEngine1 = new Sunisoft.IrisSkin.SkinEngine(((System.ComponentModel.Component)(this)));
this.richTextBox1 = new System.Windows.Forms.RichTextBox();
this.lblPhone = new System.Windows.Forms.Label();
this.txtPhone = new System.Windows.Forms.TextBox();
this.btnFasong = new System.Windows.Forms.Button();
this.btnExit2 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// skinEngine1
//
this.skinEngine1.SerialNumber = "";
this.skinEngine1.SkinFile = null;
//
// richTextBox1
//
this.richTextBox1.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(192)), ((System.Byte)(192)), ((System.Byte)(255)));
this.richTextBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.richTextBox1.ForeColor = System.Drawing.Color.Red;
this.richTextBox1.Location = new System.Drawing.Point(0, 48);
this.richTextBox1.MaxLength = 200;
this.richTextBox1.Name = "richTextBox1";
this.richTextBox1.Size = new System.Drawing.Size(512, 280);
this.richTextBox1.TabIndex = 2;
this.richTextBox1.Text = "";
this.richTextBox1.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.richTextBox1_KeyPress);
this.richTextBox1.TextChanged += new System.EventHandler(this.richTextBox1_TextChanged);
//
// lblPhone
//
this.lblPhone.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.lblPhone.ForeColor = System.Drawing.SystemColors.ControlText;
this.lblPhone.Image = ((System.Drawing.Image)(resources.GetObject("lblPhone.Image")));
this.lblPhone.Location = new System.Drawing.Point(112, 8);
this.lblPhone.Name = "lblPhone";
this.lblPhone.Size = new System.Drawing.Size(112, 23);
this.lblPhone.TabIndex = 1;
this.lblPhone.Text = "手机号码:";
this.lblPhone.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// txtPhone
//
this.txtPhone.Location = new System.Drawing.Point(224, 8);
this.txtPhone.MaxLength = 11;
this.txtPhone.Name = "txtPhone";
this.txtPhone.Size = new System.Drawing.Size(168, 21);
this.txtPhone.TabIndex = 1;
this.txtPhone.Text = "";
this.txtPhone.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtPhone_KeyPress);
this.txtPhone.Leave += new System.EventHandler(this.txtPhone_Leave);
//
// btnFasong
//
this.btnFasong.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.btnFasong.Location = new System.Drawing.Point(136, 344);
this.btnFasong.Name = "btnFasong";
this.btnFasong.TabIndex = 3;
this.btnFasong.Text = "发送(&S)";
this.btnFasong.Click += new System.EventHandler(this.btnFasong_Click);
//
// btnExit2
//
this.btnExit2.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.btnExit2.Location = new System.Drawing.Point(296, 344);
this.btnExit2.Name = "btnExit2";
this.btnExit2.TabIndex = 4;
this.btnExit2.Text = "取消(&E)";
this.btnExit2.Click += new System.EventHandler(this.btnExit2_Click);
//
// Xinduanxin
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage")));
this.ClientSize = new System.Drawing.Size(512, 381);
this.Controls.Add(this.btnExit2);
this.Controls.Add(this.btnFasong);
this.Controls.Add(this.txtPhone);
this.Controls.Add(this.lblPhone);
this.Controls.Add(this.richTextBox1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.MaximizeBox = false;
this.Name = "Xinduanxin";
this.Opacity = 0.5;
this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
this.Text = "新短信";
this.Load += new System.EventHandler(this.Xinduanxin_Load);
this.ResumeLayout(false);
}
#endregion
private void btnExit2_Click(object sender, System.EventArgs e)
{
this.Close();
}
private void richTextBox1_TextChanged(object sender, System.EventArgs e)
{
}
private void btnFasong_Click(object sender, System.EventArgs e)
{
if(this.txtPhone.Text.Length==11&&this.richTextBox1.Text.Length!=0)
{
string bb=this.txtPhone.Text;
if(bb.Substring(0,2)=="13"||
bb.Substring(0,3)=="150"||
bb.Substring(0,3)=="156"||
bb.Substring(0,3)=="158"||
bb.Substring(0,3)=="159")
{
SM.Datetime=Convert.ToString(DateTime.Now);
SM.Jnum=this.txtPhone.Text;
SM.Minfo=this.richTextBox1.Text;
SM.Fnum=frmLogin.use.Unum;
Sendmessagebox sb=new Sendmessagebox();
sb.Sendinfo(SM);
if(this.txtPhone.Text==frmLogin.use.Unum)
{
Recvivemessagebox rm=new Recvivemessagebox();
rm.Wsendinfo(SM);
frmPiao PP=new frmPiao();
PP.Show();
}
MessageBox.Show("发送成功","提示:",MessageBoxButtons.OK,MessageBoxIcon.Information);
this.txtPhone.Clear();
this.richTextBox1.Clear();
this.Hide();
}
else
{
MessageBox.Show("无次手机号码,请重新输入","警告:",MessageBoxButtons.OK,MessageBoxIcon.Warning);
this.txtPhone.Clear();
this.txtPhone.Focus();
}
}
else
{
MessageBox.Show("信息不完整","提示:");
if(this.txtPhone.Text.Length!=11)
{
this.txtPhone.Focus();
}
if(this.richTextBox1.Text.Length==0)
{
this.richTextBox1.Focus();
}
}
}
private void Xinduanxin_Load(object sender, System.EventArgs e)
{
}
private void txtPhone_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
{
e.Handled=e.KeyChar<'0'||e.KeyChar>'9';
if(e.KeyChar==(char)8)
e.Handled=false;
}
private void txtPhone_Leave(object sender, System.EventArgs e)
{
}
private void richTextBox1_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
{
e.Handled=e.KeyChar<'0'||e.KeyChar>'z';
if(e.KeyChar==(char)8)
e.Handled=false;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -