?? demomain.cs
字號:
using System;
using System.IO;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using ImApiDotNet;
namespace NetDemo
{
/// <summary>
/// Form1 的摘要說明。
/// </summary>
public class FrmDemo : System.Windows.Forms.Form
{
private ImApiDotNet.APIClient apiclient;
private System.Windows.Forms.TextBox textUrl;
private System.Windows.Forms.Button btnExit;
private System.Windows.Forms.Button btnRecvRpt;
private System.Windows.Forms.Button btnRecvSM;
private System.Windows.Forms.Button btnSend;
private System.Windows.Forms.Button btnRelease;
private System.Windows.Forms.Button btnInit;
private System.Windows.Forms.TextBox textPassword;
private System.Windows.Forms.Label lblPws;
private System.Windows.Forms.TextBox textUsername;
private System.Windows.Forms.Label lblUser;
private System.Windows.Forms.TextBox textCode;
private System.Windows.Forms.Label lblCode;
private System.Windows.Forms.TextBox textIp;
private System.Windows.Forms.Label lblIP;
private System.Windows.Forms.TextBox textSmId;
private System.Windows.Forms.Label lblSMID;
private System.Windows.Forms.TextBox textContext;
private System.Windows.Forms.Label lblContent;
private System.Windows.Forms.TextBox textMobile;
private System.Windows.Forms.Label lblMobile;
private String[] retunvalues=new String[]{"初始化成功","連接數據庫出錯","數據庫關閉失敗","數據庫插入錯誤","數據庫刪除錯誤","數據庫查詢錯誤","參數錯誤","API標識非法","消息內容太長","沒有初始化或初始化失敗","API接口處于暫停(失效)狀態","短信網關未連接"};
private String[] initvalues = new String[]{"成功","連接失敗","用戶名或密碼錯誤","密碼錯誤","接口編碼不存在"};
private System.Windows.Forms.GroupBox dbConGroup;
private System.Windows.Forms.Label lblSmType;
private System.Windows.Forms.RadioButton rbnNormal;
private System.Windows.Forms.RadioButton rbnWap;
private System.Windows.Forms.Label lblUrl;
private System.Windows.Forms.Label lblphoneID;
private System.Windows.Forms.Label labelTime;
private System.Windows.Forms.TextBox txtSMTime;
private System.Windows.Forms.Label lbSMTime;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label lbDemo;
private System.Windows.Forms.TextBox txtDB;
private System.Windows.Forms.TextBox txtSrcID;
/// <summary>
/// 必需的設計器變量。
/// </summary>
private System.ComponentModel.Container components = null;
public FrmDemo()
{
//
// Windows 窗體設計器支持所必需的
//
InitializeComponent();
//
// TODO: 在 InitializeComponent 調用后添加任何構造函數代碼
//
}
/// <summary>
/// 清理所有正在使用的資源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
/// 設計器支持所需的方法 - 不要使用代碼編輯器修改
/// 此方法的內容。
/// </summary>
private void InitializeComponent()
{
this.textUrl = new System.Windows.Forms.TextBox();
this.btnExit = new System.Windows.Forms.Button();
this.btnRecvRpt = new System.Windows.Forms.Button();
this.btnRecvSM = new System.Windows.Forms.Button();
this.btnSend = new System.Windows.Forms.Button();
this.btnRelease = new System.Windows.Forms.Button();
this.btnInit = new System.Windows.Forms.Button();
this.dbConGroup = new System.Windows.Forms.GroupBox();
this.txtDB = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.textPassword = new System.Windows.Forms.TextBox();
this.lblPws = new System.Windows.Forms.Label();
this.textUsername = new System.Windows.Forms.TextBox();
this.lblUser = new System.Windows.Forms.Label();
this.textCode = new System.Windows.Forms.TextBox();
this.lblCode = new System.Windows.Forms.Label();
this.textIp = new System.Windows.Forms.TextBox();
this.lblIP = new System.Windows.Forms.Label();
this.textSmId = new System.Windows.Forms.TextBox();
this.lblSMID = new System.Windows.Forms.Label();
this.textContext = new System.Windows.Forms.TextBox();
this.lblContent = new System.Windows.Forms.Label();
this.textMobile = new System.Windows.Forms.TextBox();
this.lblMobile = new System.Windows.Forms.Label();
this.lblSmType = new System.Windows.Forms.Label();
this.rbnNormal = new System.Windows.Forms.RadioButton();
this.rbnWap = new System.Windows.Forms.RadioButton();
this.lblUrl = new System.Windows.Forms.Label();
this.lblphoneID = new System.Windows.Forms.Label();
this.txtSrcID = new System.Windows.Forms.TextBox();
this.labelTime = new System.Windows.Forms.Label();
this.txtSMTime = new System.Windows.Forms.TextBox();
this.lbSMTime = new System.Windows.Forms.Label();
this.lbDemo = new System.Windows.Forms.Label();
this.dbConGroup.SuspendLayout();
this.SuspendLayout();
//
// textUrl
//
this.textUrl.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.textUrl.Enabled = false;
this.textUrl.Location = new System.Drawing.Point(192, 264);
this.textUrl.Name = "textUrl";
this.textUrl.Size = new System.Drawing.Size(336, 21);
this.textUrl.TabIndex = 31;
this.textUrl.Text = "";
//
// btnExit
//
this.btnExit.Location = new System.Drawing.Point(456, 440);
this.btnExit.Name = "btnExit";
this.btnExit.Size = new System.Drawing.Size(72, 24);
this.btnExit.TabIndex = 29;
this.btnExit.Text = "exit";
this.btnExit.Click += new System.EventHandler(this.btnExit_Click);
//
// btnRecvRpt
//
this.btnRecvRpt.Location = new System.Drawing.Point(360, 440);
this.btnRecvRpt.Name = "btnRecvRpt";
this.btnRecvRpt.Size = new System.Drawing.Size(80, 24);
this.btnRecvRpt.TabIndex = 28;
this.btnRecvRpt.Text = "receiveRPT";
this.btnRecvRpt.Click += new System.EventHandler(this.btnRecvRpt_Click);
//
// btnRecvSM
//
this.btnRecvSM.Location = new System.Drawing.Point(272, 440);
this.btnRecvSM.Name = "btnRecvSM";
this.btnRecvSM.Size = new System.Drawing.Size(72, 24);
this.btnRecvSM.TabIndex = 27;
this.btnRecvSM.Text = "receiveSM";
this.btnRecvSM.Click += new System.EventHandler(this.btnRecvSM_Click);
//
// btnSend
//
this.btnSend.Location = new System.Drawing.Point(192, 440);
this.btnSend.Name = "btnSend";
this.btnSend.Size = new System.Drawing.Size(64, 24);
this.btnSend.TabIndex = 26;
this.btnSend.Text = "send";
this.btnSend.Click += new System.EventHandler(this.btnSend_Click);
//
// btnRelease
//
this.btnRelease.Location = new System.Drawing.Point(112, 440);
this.btnRelease.Name = "btnRelease";
this.btnRelease.Size = new System.Drawing.Size(64, 24);
this.btnRelease.TabIndex = 25;
this.btnRelease.Text = "release";
this.btnRelease.Click += new System.EventHandler(this.btnRelease_Click);
//
// btnInit
//
this.btnInit.Location = new System.Drawing.Point(32, 440);
this.btnInit.Name = "btnInit";
this.btnInit.Size = new System.Drawing.Size(64, 24);
this.btnInit.TabIndex = 24;
this.btnInit.Text = "init";
this.btnInit.Click += new System.EventHandler(this.btnInit_Click);
//
// dbConGroup
//
this.dbConGroup.Controls.AddRange(new System.Windows.Forms.Control[] {
this.txtDB,
this.label1,
this.textPassword,
this.lblPws,
this.textUsername,
this.lblUser,
this.textCode,
this.lblCode,
this.textIp,
this.lblIP});
this.dbConGroup.Location = new System.Drawing.Point(56, 304);
this.dbConGroup.Name = "dbConGroup";
this.dbConGroup.Size = new System.Drawing.Size(472, 112);
this.dbConGroup.TabIndex = 23;
this.dbConGroup.TabStop = false;
this.dbConGroup.Text = "數據庫連接信息";
//
// txtDB
//
this.txtDB.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtDB.Location = new System.Drawing.Point(88, 80);
this.txtDB.Name = "txtDB";
this.txtDB.Size = new System.Drawing.Size(120, 21);
this.txtDB.TabIndex = 15;
this.txtDB.Text = "im";
//
// label1
//
this.label1.Location = new System.Drawing.Point(8, 88);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(72, 16);
this.label1.TabIndex = 14;
this.label1.Text = "數據庫名稱";
//
// textPassword
//
this.textPassword.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.textPassword.Location = new System.Drawing.Point(320, 48);
this.textPassword.Name = "textPassword";
this.textPassword.PasswordChar = '*';
this.textPassword.Size = new System.Drawing.Size(128, 21);
this.textPassword.TabIndex = 13;
this.textPassword.Text = "dbi";
//
// lblPws
//
this.lblPws.Location = new System.Drawing.Point(256, 56);
this.lblPws.Name = "lblPws";
this.lblPws.Size = new System.Drawing.Size(40, 16);
this.lblPws.TabIndex = 12;
this.lblPws.Text = "密碼";
//
// textUsername
//
this.textUsername.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.textUsername.Location = new System.Drawing.Point(88, 48);
this.textUsername.Name = "textUsername";
this.textUsername.Size = new System.Drawing.Size(120, 21);
this.textUsername.TabIndex = 11;
this.textUsername.Text = "dbi";
//
// lblUser
//
this.lblUser.Location = new System.Drawing.Point(24, 56);
this.lblUser.Name = "lblUser";
this.lblUser.Size = new System.Drawing.Size(48, 16);
this.lblUser.TabIndex = 10;
this.lblUser.Text = "用戶名";
//
// textCode
//
this.textCode.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.textCode.Location = new System.Drawing.Point(320, 16);
this.textCode.Name = "textCode";
this.textCode.Size = new System.Drawing.Size(128, 21);
this.textCode.TabIndex = 9;
this.textCode.Text = "dbi";
//
// lblCode
//
this.lblCode.Location = new System.Drawing.Point(256, 24);
this.lblCode.Name = "lblCode";
this.lblCode.Size = new System.Drawing.Size(56, 16);
this.lblCode.TabIndex = 8;
this.lblCode.Text = "API編碼";
//
// textIp
//
this.textIp.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.textIp.Location = new System.Drawing.Point(88, 16);
this.textIp.Name = "textIp";
this.textIp.Size = new System.Drawing.Size(120, 21);
this.textIp.TabIndex = 7;
this.textIp.Text = "192.168.0.52";
//
// lblIP
//
this.lblIP.Location = new System.Drawing.Point(24, 24);
this.lblIP.Name = "lblIP";
this.lblIP.Size = new System.Drawing.Size(48, 16);
this.lblIP.TabIndex = 6;
this.lblIP.Text = "IP地址";
//
// textSmId
//
this.textSmId.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.textSmId.Location = new System.Drawing.Point(168, 128);
this.textSmId.Name = "textSmId";
this.textSmId.Size = new System.Drawing.Size(80, 21);
this.textSmId.TabIndex = 22;
this.textSmId.Text = "10";
//
// lblSMID
//
this.lblSMID.Location = new System.Drawing.Point(88, 136);
this.lblSMID.Name = "lblSMID";
this.lblSMID.Size = new System.Drawing.Size(56, 16);
this.lblSMID.TabIndex = 21;
this.lblSMID.Text = "短信smID";
//
// textContext
//
this.textContext.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.textContext.Location = new System.Drawing.Point(168, 88);
this.textContext.Multiline = true;
this.textContext.Name = "textContext";
this.textContext.Size = new System.Drawing.Size(296, 32);
this.textContext.TabIndex = 20;
this.textContext.Text = "使用NET API發送短信!";
//
// lblContent
//
this.lblContent.Location = new System.Drawing.Point(88, 96);
this.lblContent.Name = "lblContent";
this.lblContent.Size = new System.Drawing.Size(64, 16);
this.lblContent.TabIndex = 19;
this.lblContent.Text = "短信內容";
this.lblContent.Click += new System.EventHandler(this.lblContent_Click);
//
// textMobile
//
this.textMobile.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.textMobile.Location = new System.Drawing.Point(168, 48);
this.textMobile.Multiline = true;
this.textMobile.Name = "textMobile";
this.textMobile.ScrollBars = System.Windows.Forms.ScrollBars.Horizontal;
this.textMobile.Size = new System.Drawing.Size(296, 32);
this.textMobile.TabIndex = 18;
this.textMobile.Text = "13588478293";
//
// lblMobile
//
this.lblMobile.Location = new System.Drawing.Point(72, 56);
this.lblMobile.Name = "lblMobile";
this.lblMobile.Size = new System.Drawing.Size(80, 16);
this.lblMobile.TabIndex = 17;
this.lblMobile.Text = "目的手機號碼";
//
// lblSmType
//
this.lblSmType.Location = new System.Drawing.Point(96, 240);
this.lblSmType.Name = "lblSmType";
this.lblSmType.Size = new System.Drawing.Size(72, 16);
this.lblSmType.TabIndex = 34;
this.lblSmType.Text = "短信類型";
//
// rbnNormal
//
this.rbnNormal.Checked = true;
this.rbnNormal.Location = new System.Drawing.Point(168, 232);
this.rbnNormal.Name = "rbnNormal";
this.rbnNormal.TabIndex = 35;
this.rbnNormal.TabStop = true;
this.rbnNormal.Text = "一般短信";
this.rbnNormal.CheckedChanged += new System.EventHandler(this.rbnNormal_CheckedChanged);
//
// rbnWap
//
this.rbnWap.Location = new System.Drawing.Point(336, 232);
this.rbnWap.Name = "rbnWap";
this.rbnWap.TabIndex = 36;
this.rbnWap.Text = "Wap Push短信";
this.rbnWap.CheckedChanged += new System.EventHandler(this.rbnWap_CheckedChanged);
//
// lblUrl
//
this.lblUrl.Location = new System.Drawing.Point(64, 264);
this.lblUrl.Name = "lblUrl";
this.lblUrl.Size = new System.Drawing.Size(112, 16);
this.lblUrl.TabIndex = 37;
this.lblUrl.Text = "Wap Push短信的Url";
//
// lblphoneID
//
this.lblphoneID.Location = new System.Drawing.Point(24, 208);
this.lblphoneID.Name = "lblphoneID";
this.lblphoneID.Size = new System.Drawing.Size(128, 16);
this.lblphoneID.TabIndex = 38;
this.lblphoneID.Text = "手機上顯示尾號srcID";
//
// txtSrcID
//
this.txtSrcID.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtSrcID.Location = new System.Drawing.Point(168, 200);
this.txtSrcID.Name = "txtSrcID";
this.txtSrcID.Size = new System.Drawing.Size(64, 21);
this.txtSrcID.TabIndex = 39;
this.txtSrcID.Text = "10";
//
// labelTime
//
this.labelTime.Location = new System.Drawing.Point(96, 176);
this.labelTime.Name = "labelTime";
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -