403Webshell
Server IP : 209.209.40.120  /  Your IP : 216.73.217.112
Web Server : Microsoft-IIS/10.0
System : Windows NT NEWWWW 10.0 build 17763 (Windows Server 2019) i586
User : NEWWWW$ ( 0)
PHP Version : 8.3.30
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/software/smsc smpp installer/software/Services/SMPP - Report/Backup/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/software/smsc smpp installer/software/Services/SMPP - Report/Backup/main.cs
//------------------------------------------------------------------------------
// SMSC Server components SMPP sample application
//
// $Header: $
// Copyright (c) 2003-2006 Tops. All rights reserved.
//------------------------------------------------------------------------------

using System;
using System.Windows.Forms;

using smscs.SMPP;

namespace sampleSMPP
{
	public class fmMain : System.Windows.Forms.Form
	{
		public System.Windows.Forms.TextBox txtDestTON;
		public System.Windows.Forms.TextBox txtDestNPI;
		public System.Windows.Forms.TextBox txtOrigTON;
		public System.Windows.Forms.TextBox txtOrigNPI;
		public System.Windows.Forms.TextBox txtOriginator;
		public System.Windows.Forms.TextBox txtDestination;
		public System.Windows.Forms.TextBox txtLog;
		public System.Windows.Forms.TextBox txtPort;
		public System.Windows.Forms.PictureBox Image1;
		public System.Windows.Forms.Label Label17;
		public System.Windows.Forms.Label Line2;
		public System.Windows.Forms.Label Line1;
		public System.Windows.Forms.Label Label12;
		public System.Windows.Forms.Label Label9;
		public System.Windows.Forms.Label Label7;
		public System.Windows.Forms.Label Label6;
    public System.Windows.Forms.Label Label2;
		private System.Windows.Forms.Button cmdClose;
		public System.Windows.Forms.Label label1;
		public System.Windows.Forms.Label label18;
		public System.Windows.Forms.Button cmdDeliverMessage;
		public System.Windows.Forms.Button cmdDeliverStatusReport;
		public System.Windows.Forms.Label label3;
		public System.Windows.Forms.Label label4;
		public System.Windows.Forms.Label label5;
		public System.Windows.Forms.Label label8;
		public System.Windows.Forms.Label label10;
		public System.Windows.Forms.Label label11;
		private System.Windows.Forms.ComboBox cbMessageStatus;
		private System.Windows.Forms.ComboBox cbClients;
		private System.Windows.Forms.Panel panel1;
		private System.Windows.Forms.Panel panel2;
		private System.Windows.Forms.Panel panel3;
		public System.Windows.Forms.Label label13;
		public System.Windows.Forms.TextBox txtMessageID;
		public System.Windows.Forms.Button cmdStartServer;
		public System.Windows.Forms.Button cmdStopServer;
		private System.ComponentModel.Container components = null;
		public System.Windows.Forms.TextBox txtMessage;

		private int sequenceNumber;
    private smscs.SMPP.SMSCserverSMPP SMSCserverSMPP;
		private int messageNumber;

		public fmMain()
		{
			InitializeComponent();
		}

		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if (components != null) 
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
      System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(fmMain));
      this.txtDestTON = new System.Windows.Forms.TextBox();
      this.txtDestNPI = new System.Windows.Forms.TextBox();
      this.txtOrigTON = new System.Windows.Forms.TextBox();
      this.txtOrigNPI = new System.Windows.Forms.TextBox();
      this.txtOriginator = new System.Windows.Forms.TextBox();
      this.cmdDeliverMessage = new System.Windows.Forms.Button();
      this.txtDestination = new System.Windows.Forms.TextBox();
      this.txtLog = new System.Windows.Forms.TextBox();
      this.cmdDeliverStatusReport = new System.Windows.Forms.Button();
      this.txtMessage = new System.Windows.Forms.TextBox();
      this.cmdStopServer = new System.Windows.Forms.Button();
      this.txtPort = new System.Windows.Forms.TextBox();
      this.cmdStartServer = new System.Windows.Forms.Button();
      this.Image1 = new System.Windows.Forms.PictureBox();
      this.Label17 = new System.Windows.Forms.Label();
      this.Line2 = new System.Windows.Forms.Label();
      this.Line1 = new System.Windows.Forms.Label();
      this.Label12 = new System.Windows.Forms.Label();
      this.Label9 = new System.Windows.Forms.Label();
      this.Label7 = new System.Windows.Forms.Label();
      this.Label6 = new System.Windows.Forms.Label();
      this.Label2 = new System.Windows.Forms.Label();
      this.cmdClose = new System.Windows.Forms.Button();
      this.cbClients = new System.Windows.Forms.ComboBox();
      this.label1 = new System.Windows.Forms.Label();
      this.label18 = new System.Windows.Forms.Label();
      this.label3 = new System.Windows.Forms.Label();
      this.label4 = new System.Windows.Forms.Label();
      this.txtMessageID = new System.Windows.Forms.TextBox();
      this.label5 = new System.Windows.Forms.Label();
      this.cbMessageStatus = new System.Windows.Forms.ComboBox();
      this.label8 = new System.Windows.Forms.Label();
      this.label10 = new System.Windows.Forms.Label();
      this.label11 = new System.Windows.Forms.Label();
      this.panel1 = new System.Windows.Forms.Panel();
      this.panel2 = new System.Windows.Forms.Panel();
      this.panel3 = new System.Windows.Forms.Panel();
      this.label13 = new System.Windows.Forms.Label();
      this.SMSCserverSMPP = new smscs.SMPP.SMSCserverSMPP();
      ((System.ComponentModel.ISupportInitialize)(this.Image1)).BeginInit();
      this.panel3.SuspendLayout();
      this.SuspendLayout();
      // 
      // txtDestTON
      // 
      this.txtDestTON.AcceptsReturn = true;
      this.txtDestTON.BackColor = System.Drawing.SystemColors.Window;
      this.txtDestTON.Cursor = System.Windows.Forms.Cursors.IBeam;
      this.txtDestTON.ForeColor = System.Drawing.SystemColors.WindowText;
      this.txtDestTON.Location = new System.Drawing.Point(368, 264);
      this.txtDestTON.MaxLength = 0;
      this.txtDestTON.Name = "txtDestTON";
      this.txtDestTON.RightToLeft = System.Windows.Forms.RightToLeft.No;
      this.txtDestTON.Size = new System.Drawing.Size(24, 20);
      this.txtDestTON.TabIndex = 15;
      this.txtDestTON.Text = "1";
      // 
      // txtDestNPI
      // 
      this.txtDestNPI.AcceptsReturn = true;
      this.txtDestNPI.BackColor = System.Drawing.SystemColors.Window;
      this.txtDestNPI.Cursor = System.Windows.Forms.Cursors.IBeam;
      this.txtDestNPI.ForeColor = System.Drawing.SystemColors.WindowText;
      this.txtDestNPI.Location = new System.Drawing.Point(400, 264);
      this.txtDestNPI.MaxLength = 0;
      this.txtDestNPI.Name = "txtDestNPI";
      this.txtDestNPI.RightToLeft = System.Windows.Forms.RightToLeft.No;
      this.txtDestNPI.Size = new System.Drawing.Size(24, 20);
      this.txtDestNPI.TabIndex = 16;
      this.txtDestNPI.Text = "1";
      // 
      // txtOrigTON
      // 
      this.txtOrigTON.AcceptsReturn = true;
      this.txtOrigTON.BackColor = System.Drawing.SystemColors.Window;
      this.txtOrigTON.Cursor = System.Windows.Forms.Cursors.IBeam;
      this.txtOrigTON.ForeColor = System.Drawing.SystemColors.WindowText;
      this.txtOrigTON.Location = new System.Drawing.Point(368, 240);
      this.txtOrigTON.MaxLength = 0;
      this.txtOrigTON.Name = "txtOrigTON";
      this.txtOrigTON.RightToLeft = System.Windows.Forms.RightToLeft.No;
      this.txtOrigTON.Size = new System.Drawing.Size(24, 20);
      this.txtOrigTON.TabIndex = 12;
      this.txtOrigTON.Text = "1";
      // 
      // txtOrigNPI
      // 
      this.txtOrigNPI.AcceptsReturn = true;
      this.txtOrigNPI.BackColor = System.Drawing.SystemColors.Window;
      this.txtOrigNPI.Cursor = System.Windows.Forms.Cursors.IBeam;
      this.txtOrigNPI.ForeColor = System.Drawing.SystemColors.WindowText;
      this.txtOrigNPI.Location = new System.Drawing.Point(400, 240);
      this.txtOrigNPI.MaxLength = 0;
      this.txtOrigNPI.Name = "txtOrigNPI";
      this.txtOrigNPI.RightToLeft = System.Windows.Forms.RightToLeft.No;
      this.txtOrigNPI.Size = new System.Drawing.Size(24, 20);
      this.txtOrigNPI.TabIndex = 13;
      this.txtOrigNPI.Text = "1";
      // 
      // txtOriginator
      // 
      this.txtOriginator.AcceptsReturn = true;
      this.txtOriginator.BackColor = System.Drawing.SystemColors.Window;
      this.txtOriginator.Cursor = System.Windows.Forms.Cursors.IBeam;
      this.txtOriginator.ForeColor = System.Drawing.SystemColors.WindowText;
      this.txtOriginator.Location = new System.Drawing.Point(168, 240);
      this.txtOriginator.MaxLength = 0;
      this.txtOriginator.Name = "txtOriginator";
      this.txtOriginator.RightToLeft = System.Windows.Forms.RightToLeft.No;
      this.txtOriginator.Size = new System.Drawing.Size(136, 20);
      this.txtOriginator.TabIndex = 11;
      // 
      // cmdDeliverMessage
      // 
      this.cmdDeliverMessage.BackColor = System.Drawing.SystemColors.Control;
      this.cmdDeliverMessage.Cursor = System.Windows.Forms.Cursors.Default;
      this.cmdDeliverMessage.ForeColor = System.Drawing.SystemColors.ControlText;
      this.cmdDeliverMessage.Location = new System.Drawing.Point(432, 320);
      this.cmdDeliverMessage.Name = "cmdDeliverMessage";
      this.cmdDeliverMessage.RightToLeft = System.Windows.Forms.RightToLeft.No;
      this.cmdDeliverMessage.Size = new System.Drawing.Size(69, 23);
      this.cmdDeliverMessage.TabIndex = 2;
      this.cmdDeliverMessage.Text = "Deliver";
      this.cmdDeliverMessage.UseVisualStyleBackColor = false;
      this.cmdDeliverMessage.Click += new System.EventHandler(this.cmdDeliverMessage_Click);
      // 
      // txtDestination
      // 
      this.txtDestination.AcceptsReturn = true;
      this.txtDestination.BackColor = System.Drawing.SystemColors.Window;
      this.txtDestination.Cursor = System.Windows.Forms.Cursors.IBeam;
      this.txtDestination.ForeColor = System.Drawing.SystemColors.WindowText;
      this.txtDestination.Location = new System.Drawing.Point(168, 264);
      this.txtDestination.MaxLength = 0;
      this.txtDestination.Name = "txtDestination";
      this.txtDestination.RightToLeft = System.Windows.Forms.RightToLeft.No;
      this.txtDestination.Size = new System.Drawing.Size(136, 20);
      this.txtDestination.TabIndex = 14;
      // 
      // txtLog
      // 
      this.txtLog.AcceptsReturn = true;
      this.txtLog.BackColor = System.Drawing.SystemColors.Window;
      this.txtLog.Cursor = System.Windows.Forms.Cursors.IBeam;
      this.txtLog.ForeColor = System.Drawing.SystemColors.WindowText;
      this.txtLog.Location = new System.Drawing.Point(96, 520);
      this.txtLog.MaxLength = 0;
      this.txtLog.Multiline = true;
      this.txtLog.Name = "txtLog";
      this.txtLog.ReadOnly = true;
      this.txtLog.RightToLeft = System.Windows.Forms.RightToLeft.No;
      this.txtLog.ScrollBars = System.Windows.Forms.ScrollBars.Both;
      this.txtLog.Size = new System.Drawing.Size(408, 101);
      this.txtLog.TabIndex = 22;
      this.txtLog.WordWrap = false;
      // 
      // cmdDeliverStatusReport
      // 
      this.cmdDeliverStatusReport.BackColor = System.Drawing.SystemColors.Control;
      this.cmdDeliverStatusReport.Cursor = System.Windows.Forms.Cursors.Default;
      this.cmdDeliverStatusReport.ForeColor = System.Drawing.SystemColors.ControlText;
      this.cmdDeliverStatusReport.Location = new System.Drawing.Point(432, 456);
      this.cmdDeliverStatusReport.Name = "cmdDeliverStatusReport";
      this.cmdDeliverStatusReport.RightToLeft = System.Windows.Forms.RightToLeft.No;
      this.cmdDeliverStatusReport.Size = new System.Drawing.Size(69, 23);
      this.cmdDeliverStatusReport.TabIndex = 3;
      this.cmdDeliverStatusReport.Text = "Deliver";
      this.cmdDeliverStatusReport.UseVisualStyleBackColor = false;
      this.cmdDeliverStatusReport.Click += new System.EventHandler(this.cmdDeliverStatusReport_Click);
      // 
      // txtMessage
      // 
      this.txtMessage.AcceptsReturn = true;
      this.txtMessage.BackColor = System.Drawing.SystemColors.Window;
      this.txtMessage.Cursor = System.Windows.Forms.Cursors.IBeam;
      this.txtMessage.ForeColor = System.Drawing.SystemColors.WindowText;
      this.txtMessage.Location = new System.Drawing.Point(168, 288);
      this.txtMessage.MaxLength = 0;
      this.txtMessage.Multiline = true;
      this.txtMessage.Name = "txtMessage";
      this.txtMessage.RightToLeft = System.Windows.Forms.RightToLeft.No;
      this.txtMessage.Size = new System.Drawing.Size(256, 53);
      this.txtMessage.TabIndex = 17;
      // 
      // cmdStopServer
      // 
      this.cmdStopServer.BackColor = System.Drawing.SystemColors.Control;
      this.cmdStopServer.Cursor = System.Windows.Forms.Cursors.Default;
      this.cmdStopServer.ForeColor = System.Drawing.SystemColors.ControlText;
      this.cmdStopServer.Location = new System.Drawing.Point(432, 96);
      this.cmdStopServer.Name = "cmdStopServer";
      this.cmdStopServer.RightToLeft = System.Windows.Forms.RightToLeft.No;
      this.cmdStopServer.Size = new System.Drawing.Size(69, 23);
      this.cmdStopServer.TabIndex = 1;
      this.cmdStopServer.Text = "Stop";
      this.cmdStopServer.UseVisualStyleBackColor = false;
      this.cmdStopServer.Click += new System.EventHandler(this.cmdStopServer_Click);
      // 
      // txtPort
      // 
      this.txtPort.AcceptsReturn = true;
      this.txtPort.BackColor = System.Drawing.SystemColors.Window;
      this.txtPort.Cursor = System.Windows.Forms.Cursors.IBeam;
      this.txtPort.ForeColor = System.Drawing.SystemColors.WindowText;
      this.txtPort.Location = new System.Drawing.Point(168, 64);
      this.txtPort.MaxLength = 0;
      this.txtPort.Name = "txtPort";
      this.txtPort.RightToLeft = System.Windows.Forms.RightToLeft.No;
      this.txtPort.Size = new System.Drawing.Size(88, 20);
      this.txtPort.TabIndex = 5;
      this.txtPort.Text = "2345";
      // 
      // cmdStartServer
      // 
      this.cmdStartServer.BackColor = System.Drawing.SystemColors.Control;
      this.cmdStartServer.Cursor = System.Windows.Forms.Cursors.Default;
      this.cmdStartServer.ForeColor = System.Drawing.SystemColors.ControlText;
      this.cmdStartServer.Location = new System.Drawing.Point(432, 64);
      this.cmdStartServer.Name = "cmdStartServer";
      this.cmdStartServer.RightToLeft = System.Windows.Forms.RightToLeft.No;
      this.cmdStartServer.Size = new System.Drawing.Size(69, 23);
      this.cmdStartServer.TabIndex = 0;
      this.cmdStartServer.Text = "Start";
      this.cmdStartServer.UseVisualStyleBackColor = false;
      this.cmdStartServer.Click += new System.EventHandler(this.cmdStartServer_Click);
      // 
      // Image1
      // 
      this.Image1.Cursor = System.Windows.Forms.Cursors.Default;
      this.Image1.Image = ((System.Drawing.Image)(resources.GetObject("Image1.Image")));
      this.Image1.Location = new System.Drawing.Point(24, 20);
      this.Image1.Name = "Image1";
      this.Image1.Size = new System.Drawing.Size(48, 48);
      this.Image1.TabIndex = 68;
      this.Image1.TabStop = false;
      // 
      // Label17
      // 
      this.Label17.AutoSize = true;
      this.Label17.BackColor = System.Drawing.SystemColors.Control;
      this.Label17.Cursor = System.Windows.Forms.Cursors.Default;
      this.Label17.ForeColor = System.Drawing.SystemColors.ControlText;
      this.Label17.Location = new System.Drawing.Point(96, 504);
      this.Label17.Name = "Label17";
      this.Label17.RightToLeft = System.Windows.Forms.RightToLeft.No;
      this.Label17.Size = new System.Drawing.Size(55, 13);
      this.Label17.TabIndex = 84;
      this.Label17.Text = "Event log:";
      // 
      // Line2
      // 
      this.Line2.BackColor = System.Drawing.SystemColors.AppWorkspace;
      this.Line2.Location = new System.Drawing.Point(88, 496);
      this.Line2.Name = "Line2";
      this.Line2.Size = new System.Drawing.Size(424, 1);
      this.Line2.TabIndex = 85;
      // 
      // Line1
      // 
      this.Line1.BackColor = System.Drawing.SystemColors.AppWorkspace;
      this.Line1.Location = new System.Drawing.Point(88, 128);
      this.Line1.Name = "Line1";
      this.Line1.Size = new System.Drawing.Size(424, 1);
      this.Line1.TabIndex = 86;
      // 
      // Label12
      // 
      this.Label12.AutoSize = true;
      this.Label12.BackColor = System.Drawing.SystemColors.Control;
      this.Label12.Cursor = System.Windows.Forms.Cursors.Default;
      this.Label12.ForeColor = System.Drawing.SystemColors.ControlText;
      this.Label12.Location = new System.Drawing.Point(309, 243);
      this.Label12.Name = "Label12";
      this.Label12.RightToLeft = System.Windows.Forms.RightToLeft.No;
      this.Label12.Size = new System.Drawing.Size(56, 13);
      this.Label12.TabIndex = 78;
      this.Label12.Text = "TON/NPI:";
      // 
      // Label9
      // 
      this.Label9.AutoSize = true;
      this.Label9.BackColor = System.Drawing.SystemColors.Control;
      this.Label9.Cursor = System.Windows.Forms.Cursors.Default;
      this.Label9.ForeColor = System.Drawing.SystemColors.ControlText;
      this.Label9.Location = new System.Drawing.Point(96, 242);
      this.Label9.Name = "Label9";
      this.Label9.RightToLeft = System.Windows.Forms.RightToLeft.No;
      this.Label9.Size = new System.Drawing.Size(55, 13);
      this.Label9.TabIndex = 76;
      this.Label9.Text = "Originator:";
      // 
      // Label7
      // 
      this.Label7.AutoSize = true;
      this.Label7.BackColor = System.Drawing.SystemColors.Control;
      this.Label7.Cursor = System.Windows.Forms.Cursors.Default;
      this.Label7.ForeColor = System.Drawing.SystemColors.ControlText;
      this.Label7.Location = new System.Drawing.Point(96, 293);
      this.Label7.Name = "Label7";
      this.Label7.RightToLeft = System.Windows.Forms.RightToLeft.No;
      this.Label7.Size = new System.Drawing.Size(53, 13);
      this.Label7.TabIndex = 74;
      this.Label7.Text = "Message:";
      // 
      // Label6
      // 
      this.Label6.AutoSize = true;
      this.Label6.BackColor = System.Drawing.SystemColors.Control;
      this.Label6.Cursor = System.Windows.Forms.Cursors.Default;
      this.Label6.ForeColor = System.Drawing.SystemColors.ControlText;
      this.Label6.Location = new System.Drawing.Point(96, 267);
      this.Label6.Name = "Label6";
      this.Label6.RightToLeft = System.Windows.Forms.RightToLeft.No;
      this.Label6.Size = new System.Drawing.Size(63, 13);
      this.Label6.TabIndex = 73;
      this.Label6.Text = "Destination:";
      // 
      // Label2
      // 
      this.Label2.AutoSize = true;
      this.Label2.BackColor = System.Drawing.SystemColors.Control;
      this.Label2.Cursor = System.Windows.Forms.Cursors.Default;
      this.Label2.ForeColor = System.Drawing.SystemColors.ControlText;
      this.Label2.Location = new System.Drawing.Point(96, 67);
      this.Label2.Name = "Label2";
      this.Label2.RightToLeft = System.Windows.Forms.RightToLeft.No;
      this.Label2.Size = new System.Drawing.Size(29, 13);
      this.Label2.TabIndex = 69;
      this.Label2.Text = "Port:";
      // 
      // cmdClose
      // 
      this.cmdClose.Location = new System.Drawing.Point(432, 136);
      this.cmdClose.Name = "cmdClose";
      this.cmdClose.Size = new System.Drawing.Size(69, 23);
      this.cmdClose.TabIndex = 89;
      this.cmdClose.Text = "Close";
      this.cmdClose.Click += new System.EventHandler(this.cmdClose_Click);
      // 
      // cbClients
      // 
      this.cbClients.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
      this.cbClients.Location = new System.Drawing.Point(168, 136);
      this.cbClients.Name = "cbClients";
      this.cbClients.Size = new System.Drawing.Size(88, 21);
      this.cbClients.TabIndex = 90;
      // 
      // label1
      // 
      this.label1.AutoSize = true;
      this.label1.BackColor = System.Drawing.SystemColors.Control;
      this.label1.Cursor = System.Windows.Forms.Cursors.Default;
      this.label1.ForeColor = System.Drawing.SystemColors.ControlText;
      this.label1.Location = new System.Drawing.Point(96, 139);
      this.label1.Name = "label1";
      this.label1.RightToLeft = System.Windows.Forms.RightToLeft.No;
      this.label1.Size = new System.Drawing.Size(50, 13);
      this.label1.TabIndex = 91;
      this.label1.Text = "Client ID:";
      // 
      // label18
      // 
      this.label18.BackColor = System.Drawing.SystemColors.AppWorkspace;
      this.label18.Location = new System.Drawing.Point(88, 168);
      this.label18.Name = "label18";
      this.label18.Size = new System.Drawing.Size(424, 1);
      this.label18.TabIndex = 92;
      // 
      // label3
      // 
      this.label3.AutoSize = true;
      this.label3.BackColor = System.Drawing.SystemColors.Control;
      this.label3.Cursor = System.Windows.Forms.Cursors.Default;
      this.label3.ForeColor = System.Drawing.SystemColors.ControlText;
      this.label3.Location = new System.Drawing.Point(309, 267);
      this.label3.Name = "label3";
      this.label3.RightToLeft = System.Windows.Forms.RightToLeft.No;
      this.label3.Size = new System.Drawing.Size(56, 13);
      this.label3.TabIndex = 93;
      this.label3.Text = "TON/NPI:";
      // 
      // label4
      // 
      this.label4.BackColor = System.Drawing.SystemColors.AppWorkspace;
      this.label4.Location = new System.Drawing.Point(88, 352);
      this.label4.Name = "label4";
      this.label4.Size = new System.Drawing.Size(424, 1);
      this.label4.TabIndex = 94;
      // 
      // txtMessageID
      // 
      this.txtMessageID.AcceptsReturn = true;
      this.txtMessageID.BackColor = System.Drawing.SystemColors.Window;
      this.txtMessageID.Cursor = System.Windows.Forms.Cursors.IBeam;
      this.txtMessageID.ForeColor = System.Drawing.SystemColors.WindowText;
      this.txtMessageID.Location = new System.Drawing.Point(168, 432);
      this.txtMessageID.MaxLength = 0;
      this.txtMessageID.Name = "txtMessageID";
      this.txtMessageID.RightToLeft = System.Windows.Forms.RightToLeft.No;
      this.txtMessageID.Size = new System.Drawing.Size(256, 20);
      this.txtMessageID.TabIndex = 95;
      // 
      // label5
      // 
      this.label5.AutoSize = true;
      this.label5.BackColor = System.Drawing.SystemColors.Control;
      this.label5.Cursor = System.Windows.Forms.Cursors.Default;
      this.label5.ForeColor = System.Drawing.SystemColors.ControlText;
      this.label5.Location = new System.Drawing.Point(96, 437);
      this.label5.Name = "label5";
      this.label5.RightToLeft = System.Windows.Forms.RightToLeft.No;
      this.label5.Size = new System.Drawing.Size(67, 13);
      this.label5.TabIndex = 96;
      this.label5.Text = "Message ID:";
      // 
      // cbMessageStatus
      // 
      this.cbMessageStatus.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
      this.cbMessageStatus.Items.AddRange(new object[] {
            "Message \"en route\" (1, msEnRoute)",
            "Message delivered (2, msDelivered)",
            "Message expired (3, msExpired)",
            "Message deleted (4, msDeleted)",
            "Message undelivereable (5, msUndeliverable)",
            "Message accepted (6, msAccepted)",
            "State unknown (7, msUnknown)",
            "Message rejected (8, msRejected)"});
      this.cbMessageStatus.Location = new System.Drawing.Point(168, 456);
      this.cbMessageStatus.Name = "cbMessageStatus";
      this.cbMessageStatus.Size = new System.Drawing.Size(256, 21);
      this.cbMessageStatus.TabIndex = 97;
      // 
      // label8
      // 
      this.label8.AutoSize = true;
      this.label8.BackColor = System.Drawing.SystemColors.Control;
      this.label8.Cursor = System.Windows.Forms.Cursors.Default;
      this.label8.ForeColor = System.Drawing.SystemColors.ControlText;
      this.label8.Location = new System.Drawing.Point(96, 458);
      this.label8.Name = "label8";
      this.label8.RightToLeft = System.Windows.Forms.RightToLeft.No;
      this.label8.Size = new System.Drawing.Size(40, 13);
      this.label8.TabIndex = 98;
      this.label8.Text = "Status:";
      // 
      // label10
      // 
      this.label10.BackColor = System.Drawing.SystemColors.Info;
      this.label10.Cursor = System.Windows.Forms.Cursors.Default;
      this.label10.ForeColor = System.Drawing.SystemColors.ControlText;
      this.label10.Location = new System.Drawing.Point(96, 184);
      this.label10.Name = "label10";
      this.label10.RightToLeft = System.Windows.Forms.RightToLeft.No;
      this.label10.Size = new System.Drawing.Size(408, 40);
      this.label10.TabIndex = 99;
      this.label10.Text = "To send a message to one of the connected clients select Client ID fill in the pa" +
          "rameters below and press Deliver button. More parameters of the delivered messag" +
          "e can be set in code.";
      // 
      // label11
      // 
      this.label11.BackColor = System.Drawing.SystemColors.Info;
      this.label11.Cursor = System.Windows.Forms.Cursors.Default;
      this.label11.ForeColor = System.Drawing.SystemColors.ControlText;
      this.label11.Location = new System.Drawing.Point(96, 368);
      this.label11.Name = "label11";
      this.label11.RightToLeft = System.Windows.Forms.RightToLeft.No;
      this.label11.Size = new System.Drawing.Size(408, 40);
      this.label11.TabIndex = 100;
      this.label11.Text = "To send a status report to one of the connected clients select Client ID fill in " +
          "the parameters below and press Deliver button. More parameters of the delivered " +
          "message can be set in code.";
      // 
      // panel1
      // 
      this.panel1.BackColor = System.Drawing.SystemColors.Info;
      this.panel1.Location = new System.Drawing.Point(88, 176);
      this.panel1.Name = "panel1";
      this.panel1.Size = new System.Drawing.Size(424, 56);
      this.panel1.TabIndex = 101;
      // 
      // panel2
      // 
      this.panel2.BackColor = System.Drawing.SystemColors.Info;
      this.panel2.Location = new System.Drawing.Point(88, 360);
      this.panel2.Name = "panel2";
      this.panel2.Size = new System.Drawing.Size(424, 56);
      this.panel2.TabIndex = 103;
      // 
      // panel3
      // 
      this.panel3.BackColor = System.Drawing.SystemColors.Info;
      this.panel3.Controls.Add(this.label13);
      this.panel3.Location = new System.Drawing.Point(88, 8);
      this.panel3.Name = "panel3";
      this.panel3.Size = new System.Drawing.Size(424, 48);
      this.panel3.TabIndex = 104;
      // 
      // label13
      // 
      this.label13.BackColor = System.Drawing.SystemColors.Info;
      this.label13.Cursor = System.Windows.Forms.Cursors.Default;
      this.label13.ForeColor = System.Drawing.SystemColors.ControlText;
      this.label13.Location = new System.Drawing.Point(8, 8);
      this.label13.Name = "label13";
      this.label13.RightToLeft = System.Windows.Forms.RightToLeft.No;
      this.label13.Size = new System.Drawing.Size(408, 32);
      this.label13.TabIndex = 100;
      this.label13.Text = "To start the SMPP server fill in the port number to listen to and press Start but" +
          "ton. To stop the server press Stop button.";
      // 
      // SMSCserverSMPP
      // 
      this.SMSCserverSMPP.KeepAliveInterval = 10;
      this.SMSCserverSMPP.ThrottleRate = 0;
      this.SMSCserverSMPP.OnSmppDeliverResponseReceived += new smscs.SMPP.smppDeliverResponseReceivedEvent(this.SMSCserverSMPP_OnSmppDeliverResponseReceived);
      this.SMSCserverSMPP.OnSmppRAWReceived += new smscs.SMPP.smppRAWReceivedEvent(this.SMSCserverSMPP_OnSmppRAWReceived);
      this.SMSCserverSMPP.OnSmppLoginReceived += new smscs.SMPP.smppLoginReceivedEvent(this.SMSCserverSMPP_OnSmppLoginReceived);
      this.SMSCserverSMPP.OnTcpConnected += new smscs.tcpConnectedEvent(this.SMSCserverSMPP_OnTcpConnected);
      this.SMSCserverSMPP.OnSmppLogoutReceived += new smscs.SMPP.smppLogoutReceivedEvent(this.SMSCserverSMPP_OnSmppLogoutReceived);
      this.SMSCserverSMPP.OnTcpDisconnected += new smscs.tcpDisconnectedEvent(this.SMSCserverSMPP_OnTcpDisconnected);
      this.SMSCserverSMPP.OnSmppSubmitMessageReceived += new smscs.SMPP.smppSubmitMessageReceivedEvent(this.SMSCserverSMPP_OnSmppSubmitMessageReceived);
      // 
      // fmMain
      // 
      this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
      this.ClientSize = new System.Drawing.Size(522, 638);
      this.Controls.Add(this.panel3);
      this.Controls.Add(this.label11);
      this.Controls.Add(this.label10);
      this.Controls.Add(this.label8);
      this.Controls.Add(this.cbMessageStatus);
      this.Controls.Add(this.txtMessageID);
      this.Controls.Add(this.label5);
      this.Controls.Add(this.label4);
      this.Controls.Add(this.label3);
      this.Controls.Add(this.label18);
      this.Controls.Add(this.label1);
      this.Controls.Add(this.cbClients);
      this.Controls.Add(this.cmdClose);
      this.Controls.Add(this.txtDestTON);
      this.Controls.Add(this.txtDestNPI);
      this.Controls.Add(this.txtOrigTON);
      this.Controls.Add(this.txtOrigNPI);
      this.Controls.Add(this.txtOriginator);
      this.Controls.Add(this.cmdDeliverMessage);
      this.Controls.Add(this.txtDestination);
      this.Controls.Add(this.txtLog);
      this.Controls.Add(this.cmdDeliverStatusReport);
      this.Controls.Add(this.txtMessage);
      this.Controls.Add(this.cmdStopServer);
      this.Controls.Add(this.txtPort);
      this.Controls.Add(this.cmdStartServer);
      this.Controls.Add(this.Image1);
      this.Controls.Add(this.Label17);
      this.Controls.Add(this.Line2);
      this.Controls.Add(this.Line1);
      this.Controls.Add(this.Label12);
      this.Controls.Add(this.Label9);
      this.Controls.Add(this.Label7);
      this.Controls.Add(this.Label6);
      this.Controls.Add(this.Label2);
      this.Controls.Add(this.panel1);
      this.Controls.Add(this.panel2);
      this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
      this.MaximizeBox = false;
      this.MinimizeBox = false;
      this.Name = "fmMain";
      this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
      this.Text = "SMSC server .NET [SMPP]";
      this.Load += new System.EventHandler(this.fmMain_Load);
      ((System.ComponentModel.ISupportInitialize)(this.Image1)).EndInit();
      this.panel3.ResumeLayout(false);
      this.ResumeLayout(false);
      this.PerformLayout();

		}
		#endregion

		private EventLog Log;

		[STAThread]

		static void Main() 
		{
			Application.Run(new fmMain());
		}

		private string getMessageID()
		{
			return "tops-smscs-" + messageNumber++.ToString("x");
		}

		private void fmMain_Load(object sender, System.EventArgs e)
		{
			Log = new EventLog(txtLog);		
			cbMessageStatus.SelectedIndex = 1;
		}

		// Start SMSC Server
		private void cmdStartServer_Click(object sender, System.EventArgs e)
		{
			SMSCserverSMPP.smppInitializeServer("", int.Parse(txtPort.Text));

			Log.AddServerStarted();
		}

		// Stop SMSC Server
		private void cmdStopServer_Click(object sender, System.EventArgs e)
		{
			SMSCserverSMPP.smppFinalizeServer();

			Log.AddServerStopped();
		}

		// Close client connection
		private void cmdClose_Click(object sender, System.EventArgs e)
		{
			if(cbClients.SelectedIndex != -1)	
			{
				int clientID = int.Parse(cbClients.Text.Replace("client ", ""));
				SMSCserverSMPP.tcpCloseConnection(clientID);
			} 
			else 
			{
				MessageBox.Show("No client connection selected. Please select " +
					"client from Client ID dropdown list to deliver message.", 
					"Information", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
			}
		}

		// Deliver (deliver_sm) a regular message to client 
		private void cmdDeliverMessage_Click(object sender, System.EventArgs e)
		{
			if(cbClients.SelectedIndex != -1)	
			{
				int clientID = int.Parse(cbClients.Text.Replace("client ", ""));

				SMSCserverSMPP.smppSendDeliverMessage(clientID, sequenceNumber++,
					txtDestination.Text, byte.Parse(txtDestTON.Text), byte.Parse(txtDestNPI.Text),
					txtOriginator.Text, byte.Parse(txtOrigTON.Text), byte.Parse(txtOrigNPI.Text), 
					txtMessage.Text, smscs.EncodingEnum.et7BitText, "", 0, "", "");

				Log.AddDeliverMessageEvent(clientID);
			} 
			else 
			{
				MessageBox.Show("No client connection selected. Please select " +
					"client from Client ID dropdown list to deliver message.", 
					"Information", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
			}
		}

    //
		// Deliver (deliver_sm) a status report to client 
    //
		private void cmdDeliverStatusReport_Click(object sender, System.EventArgs e)
		{
			if(cbClients.SelectedIndex != -1)	
			{
				int clientID = int.Parse(cbClients.Text.Replace("client ", ""));

				SMSCserverSMPP.smppSendDeliverStatusReport(clientID, sequenceNumber++,
					txtDestination.Text, byte.Parse(txtDestTON.Text), byte.Parse(txtDestNPI.Text),
					txtOriginator.Text, byte.Parse(txtOrigTON.Text), byte.Parse(txtOrigNPI.Text), 
					smppReportTypeEnum.rtFinal, "", txtMessageID.Text, 1, 1, DateTime.Now, 
          DateTime.Now,	(smppMessageStateEnum)cbMessageStatus.SelectedIndex, 
          0, txtMessage.Text, "");

        Log.AddDeliverStatusReport(clientID);
			} 
			else 
			{
				MessageBox.Show("No client connection selected. Please select " +
					"client from Client ID dropdown list to deliver message.", 
					"Information", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
			}
		}

    //
    // Event fired on client connect on TCP/IP level
    //
    private void SMSCserverSMPP_OnTcpConnected(object sender, 
      smscs.tcpConnectedEventArgs e)
    {
      //
      // Here you can examine information like client's
      // address (e.RemoteHost) and/or port (e.RemotePort)
      // and either accept connection (tcpAcceptConnection)
      // or reject it (tcpCloseConnection).
      //

      SMSCserverSMPP.tcpAcceptConnection(e.ClientID);
      cbClients.Items.Add("client " + e.ClientID.ToString());

      Log.AddConnectedEvent(e.ClientID, e.RemoteHost, e.RemotePort);
    }

    //
    // Event fired on client disconnection on TCP/IP level
    //
    private void SMSCserverSMPP_OnTcpDisconnected(object sender, 
      smscs.tcpDisconnectedEventArgs e)
    {
      //
      // This event can be used to remove connection from
      // application's internal structures.
      //
      
      int i = cbClients.Items.IndexOf("client " + e.ClientID.ToString());
      if (i != -1) cbClients.Items.RemoveAt(i);

      Log.AddDisconnectedEvent(e.ClientID, e.Reason);
    }

    //
    // Event fired when an SMPP message is received that is not 
    // reported by any other events.
    //
    private void SMSCserverSMPP_OnSmppRAWReceived(object sender, 
      smscs.SMPP.smppRAWReceivedEventArgs e)
    {
      Log.AddReceivedGeneric(e.ClientID);
    }

    // 
    // Event fired on login (bind) message receive
    //
    private void SMSCserverSMPP_OnSmppLoginReceived(object sender, 
      smscs.SMPP.smppLoginReceivedEventArgs e)
    {
      //
      // Here client tries to login to the SMSC. On the basis of 
      // information passed server has to decide what status code to 
      // pass and/or whether to close the connection. Information
      // that can be examined is account name (e.SystemID), password
      // (e.Password), bind mode (transceiver, transmitter or receiver 
      // contained in e.BindMode) etc.
      //
      // Login status is passed to the client via smppSendLoginResponse and
      // if client should be rejected the connection should be dropped
      // using tcpCloseConnection.
      //

      SMSCserverSMPP.smppSendLoginResponse(e.ClientID, e.SequenceNumber, e.BindMode,
        0, "tops-smsc");

      Log.AddReceivedLoginEvent(e.ClientID);
    }

    //
    // Event fired on logout (unbind) message receive
    //
    private void SMSCserverSMPP_OnSmppLogoutReceived(object sender, 
      smscs.SMPP.smppLogoutReceivedEventArgs e)
    {
      //
      // To close the connection on SMPP level gracefully 
      // server should respond with smppSendLogoutResponse function.
      // Then after waiting a while it can drop the connection 
      // using tcpCloseConnection. The wait is time to finish 
      // transmitting the response and possibly client closing 
      // the connection on TCP/IP level.
      //

      SMSCserverSMPP.smppSendLogoutResponse(e.ClientID, e.SequenceNumber, 0);

      Log.AddReceivedLogoutEvent(e.ClientID);
    }

    //
    // Event fired when message to submit is received (send_sm) from client
    //
    private void SMSCserverSMPP_OnSmppSubmitMessageReceived(object sender, 
      smscs.SMPP.smppSubmitMessageReceivedEventArgs e)
    {
      //
      // After receiving message server should analyze it and 
      // send an appropriate status code in return. Status can be 
      // of course forwarded from ahother SMPP entity while proxying
      // or generated on the basis of message analysis (e.g. destination
      // number, content etc.)
      //
      
      String MessageID = getMessageID();

      SMSCserverSMPP.smppSendSubmitMessageResponse(e.ClientID, e.SequenceNumber, 0, MessageID);
      txtMessageID.Text = MessageID;

      Log.AddReceivedSubmitMessageEvent(e.ClientID);
    }

    //
    // Event fired when response to message or status response (deliver_sm)
    // has been received from the client party
    //
    private void SMSCserverSMPP_OnSmppDeliverResponseReceived(object sender, 
      smscs.SMPP.smppDeliverResponseReceivedEventArgs e)
    {
      //
      // This ensures that message or status report sent earlier using 
      // smppSendDeliverMessage or smppSendDeliverStatusReport has been 
      // received by the client application. Appropriate transaction is 
      // identified via e.SequenceNumber field.
      //
      
      Log.AddReceivedDeliverResponseEvent(e.ClientID);
    }
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit