using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Threading;
using System.Net;
using System.Net.Sockets;
using System.Text;
namespace SaTaNaDcMaSS
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class MassM : System.Windows.Forms.Form
{
Socket s;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button button1;
private Thread masst;
private System.Windows.Forms.CheckBox c1;
private System.Windows.Forms.CheckBox c2;
private System.Windows.Forms.TextBox mess;
private System.Windows.Forms.RichTextBox boh;
private System.Windows.Forms.Timer timer;
private System.ComponentModel.IContainer components;
private System.Windows.Forms.RichTextBox tempo2;
private System.Windows.Forms.Label label3;
private int tempo;
private string hub;
private string porta;
public MassM(string hub,string porta)
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
this.hub=hub;
this.porta=porta;
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
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()
{
this.
components = new System.ComponentModel.
Container();
System.Resources.
ResourceManager resources
= new System.Resources.
ResourceManager(typeof(MassM
));
this.
label1 = new System.
Windows.
Forms.
Label();
this.
mess = new System.
Windows.
Forms.
TextBox();
this.
c1 = new System.
Windows.
Forms.
CheckBox();
this.
c2 = new System.
Windows.
Forms.
CheckBox();
this.
button1 = new System.
Windows.
Forms.
Button();
this.
boh = new System.
Windows.
Forms.
RichTextBox();
this.
timer = new System.
Windows.
Forms.
Timer(this.
components);
this.
tempo2 = new System.
Windows.
Forms.
RichTextBox();
this.
label3 = new System.
Windows.
Forms.
Label();
this.SuspendLayout();
//
// label1
//
this.label1.AccessibleDescription = resources.GetString("label1.AccessibleDescription");
this.label1.AccessibleName = resources.GetString("label1.AccessibleName");
this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("label1.Anchor")));
this.label1.AutoSize = ((bool)(resources.GetObject("label1.AutoSize")));
this.label1.BackColor = System.Drawing.Color.Blue;
this.label1.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("label1.Dock")));
this.label1.Enabled = ((bool)(resources.GetObject("label1.Enabled")));
this.label1.Font = ((System.Drawing.Font)(resources.GetObject("label1.Font")));
this.label1.ForeColor = System.Drawing.Color.Yellow;
this.label1.Image = ((System.Drawing.Image)(resources.GetObject("label1.Image")));
this.label1.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("label1.ImageAlign")));
this.label1.ImageIndex = ((int)(resources.GetObject("label1.ImageIndex")));
this.label1.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("label1.ImeMode")));
this.label1.Location = ((System.Drawing.Point)(resources.GetObject("label1.Location")));
this.label1.Name = "label1";
this.label1.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("label1.RightToLeft")));
this.label1.Size = ((System.Drawing.Size)(resources.GetObject("label1.Size")));
this.label1.TabIndex = ((int)(resources.GetObject("label1.TabIndex")));
this.label1.Text = resources.GetString("label1.Text");
this.label1.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("label1.TextAlign")));
this.label1.Visible = ((bool)(resources.GetObject("label1.Visible")));
//
// mess
//
this.mess.AccessibleDescription = resources.GetString("mess.AccessibleDescription");
this.mess.AccessibleName = resources.GetString("mess.AccessibleName");
this.mess.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("mess.Anchor")));
this.mess.AutoSize = ((bool)(resources.GetObject("mess.AutoSize")));
this.mess.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("mess.BackgroundImage")));
this.mess.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("mess.Dock")));
this.mess.Enabled = ((bool)(resources.GetObject("mess.Enabled")));
this.mess.Font = ((System.Drawing.Font)(resources.GetObject("mess.Font")));
this.mess.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("mess.ImeMode")));
this.mess.Location = ((System.Drawing.Point)(resources.GetObject("mess.Location")));
this.mess.MaxLength = ((int)(resources.GetObject("mess.MaxLength")));
this.mess.Multiline = ((bool)(resources.GetObject("mess.Multiline")));
this.mess.Name = "mess";
this.mess.PasswordChar = ((char)(resources.GetObject("mess.PasswordChar")));
this.mess.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("mess.RightToLeft")));
this.mess.ScrollBars = ((System.Windows.Forms.ScrollBars)(resources.GetObject("mess.ScrollBars")));
this.mess.Size = ((System.Drawing.Size)(resources.GetObject("mess.Size")));
this.mess.TabIndex = ((int)(resources.GetObject("mess.TabIndex")));
this.mess.Text = resources.GetString("mess.Text");
this.mess.TextAlign = ((System.Windows.Forms.HorizontalAlignment)(resources.GetObject("mess.TextAlign")));
this.mess.Visible = ((bool)(resources.GetObject("mess.Visible")));
this.mess.WordWrap = ((bool)(resources.GetObject("mess.WordWrap")));
//
// c1
//
this.c1.AccessibleDescription = resources.GetString("c1.AccessibleDescription");
this.c1.AccessibleName = resources.GetString("c1.AccessibleName");
this.c1.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("c1.Anchor")));
this.c1.Appearance = ((System.Windows.Forms.Appearance)(resources.GetObject("c1.Appearance")));
this.c1.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("c1.BackgroundImage")));
this.c1.CheckAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("c1.CheckAlign")));
this.c1.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("c1.Dock")));
this.c1.Enabled = ((bool)(resources.GetObject("c1.Enabled")));
this.c1.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("c1.FlatStyle")));
this.c1.Font = ((System.Drawing.Font)(resources.GetObject("c1.Font")));
this.c1.ForeColor = System.Drawing.Color.Yellow;
this.c1.Image = ((System.Drawing.Image)(resources.GetObject("c1.Image")));
this.c1.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("c1.ImageAlign")));
this.c1.ImageIndex = ((int)(resources.GetObject("c1.ImageIndex")));
this.c1.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("c1.ImeMode")));
this.c1.Location = ((System.Drawing.Point)(resources.GetObject("c1.Location")));
this.c1.Name = "c1";
this.c1.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("c1.RightToLeft")));
this.c1.Size = ((System.Drawing.Size)(resources.GetObject("c1.Size")));
this.c1.TabIndex = ((int)(resources.GetObject("c1.TabIndex")));
this.c1.Text = resources.GetString("c1.Text");
this.c1.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("c1.TextAlign")));
this.c1.Visible = ((bool)(resources.GetObject("c1.Visible")));
//
// c2
//
this.c2.AccessibleDescription = resources.GetString("c2.AccessibleDescription");
this.c2.AccessibleName = resources.GetString("c2.AccessibleName");
this.c2.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("c2.Anchor")));
this.c2.Appearance = ((System.Windows.Forms.Appearance)(resources.GetObject("c2.Appearance")));
this.c2.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("c2.BackgroundImage")));
this.c2.CheckAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("c2.CheckAlign")));
this.c2.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("c2.Dock")));
this.c2.Enabled = ((bool)(resources.GetObject("c2.Enabled")));
this.c2.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("c2.FlatStyle")));
this.c2.Font = ((System.Drawing.Font)(resources.GetObject("c2.Font")));
this.c2.ForeColor = System.Drawing.Color.Yellow;
this.c2.Image = ((System.Drawing.Image)(resources.GetObject("c2.Image")));
this.c2.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("c2.ImageAlign")));
this.c2.ImageIndex = ((int)(resources.GetObject("c2.ImageIndex")));
this.c2.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("c2.ImeMode")));
this.c2.Location = ((System.Drawing.Point)(resources.GetObject("c2.Location")));
this.c2.Name = "c2";
this.c2.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("c2.RightToLeft")));
this.c2.Size = ((System.Drawing.Size)(resources.GetObject("c2.Size")));
this.c2.TabIndex = ((int)(resources.GetObject("c2.TabIndex")));
this.c2.Text = resources.GetString("c2.Text");
this.c2.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("c2.TextAlign")));
this.c2.Visible = ((bool)(resources.GetObject("c2.Visible")));
//
// button1
//
this.button1.AccessibleDescription = resources.GetString("button1.AccessibleDescription");
this.button1.AccessibleName = resources.GetString("button1.AccessibleName");
this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("button1.Anchor")));
this.button1.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("button1.BackgroundImage")));
this.button1.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.button1.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("button1.Dock")));
this.button1.Enabled = ((bool)(resources.GetObject("button1.Enabled")));
this.button1.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("button1.FlatStyle")));
this.button1.Font = ((System.Drawing.Font)(resources.GetObject("button1.Font")));
this.button1.ForeColor = System.Drawing.Color.Yellow;
this.button1.Image = ((System.Drawing.Image)(resources.GetObject("button1.Image")));
this.button1.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("button1.ImageAlign")));
this.button1.ImageIndex = ((int)(resources.GetObject("button1.ImageIndex")));
this.button1.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("button1.ImeMode")));
this.button1.Location = ((System.Drawing.Point)(resources.GetObject("button1.Location")));
this.button1.Name = "button1";
this.button1.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("button1.RightToLeft")));
this.button1.Size = ((System.Drawing.Size)(resources.GetObject("button1.Size")));
this.button1.TabIndex = ((int)(resources.GetObject("button1.TabIndex")));
this.button1.Text = resources.GetString("button1.Text");
this.button1.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("button1.TextAlign")));
this.button1.Visible = ((bool)(resources.GetObject("button1.Visible")));
this.
button1.
Click += new System.
EventHandler(this.
button1_Click);
//
// boh
//
this.boh.AccessibleDescription = resources.GetString("boh.AccessibleDescription");
this.boh.AccessibleName = resources.GetString("boh.AccessibleName");
this.boh.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("boh.Anchor")));
this.boh.AutoSize = ((bool)(resources.GetObject("boh.AutoSize")));
this.boh.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("boh.BackgroundImage")));
this.boh.BulletIndent = ((int)(resources.GetObject("boh.BulletIndent")));
this.boh.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("boh.Dock")));
this.boh.Enabled = ((bool)(resources.GetObject("boh.Enabled")));
this.boh.Font = ((System.Drawing.Font)(resources.GetObject("boh.Font")));
this.boh.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("boh.ImeMode")));
this.boh.Location = ((System.Drawing.Point)(resources.GetObject("boh.Location")));
this.boh.MaxLength = ((int)(resources.GetObject("boh.MaxLength")));
this.boh.Multiline = ((bool)(resources.GetObject("boh.Multiline")));
this.boh.Name = "boh";
this.boh.ReadOnly = true;
this.boh.RightMargin = ((int)(resources.GetObject("boh.RightMargin")));
this.boh.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("boh.RightToLeft")));
this.boh.ScrollBars = ((System.Windows.Forms.RichTextBoxScrollBars)(resources.GetObject("boh.ScrollBars")));
this.boh.Size = ((System.Drawing.Size)(resources.GetObject("boh.Size")));
this.boh.TabIndex = ((int)(resources.GetObject("boh.TabIndex")));
this.boh.Text = resources.GetString("boh.Text");
this.boh.Visible = ((bool)(resources.GetObject("boh.Visible")));
this.boh.WordWrap = ((bool)(resources.GetObject("boh.WordWrap")));
this.boh.ZoomFactor = ((System.Single)(resources.GetObject("boh.ZoomFactor")));
//
// timer
//
this.timer.Interval = 1;
this.
timer.
Tick += new System.
EventHandler(this.
timer_Tick);
//
// tempo2
//
this.tempo2.AccessibleDescription = resources.GetString("tempo2.AccessibleDescription");
this.tempo2.AccessibleName = resources.GetString("tempo2.AccessibleName");
this.tempo2.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("tempo2.Anchor")));
this.tempo2.AutoSize = ((bool)(resources.GetObject("tempo2.AutoSize")));
this.tempo2.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("tempo2.BackgroundImage")));
this.tempo2.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.tempo2.BulletIndent = ((int)(resources.GetObject("tempo2.BulletIndent")));
this.tempo2.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("tempo2.Dock")));
this.tempo2.Enabled = ((bool)(resources.GetObject("tempo2.Enabled")));
this.tempo2.Font = ((System.Drawing.Font)(resources.GetObject("tempo2.Font")));
this.tempo2.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("tempo2.ImeMode")));
this.tempo2.Location = ((System.Drawing.Point)(resources.GetObject("tempo2.Location")));
this.tempo2.MaxLength = ((int)(resources.GetObject("tempo2.MaxLength")));
this.tempo2.Multiline = ((bool)(resources.GetObject("tempo2.Multiline")));
this.tempo2.Name = "tempo2";
this.tempo2.RightMargin = ((int)(resources.GetObject("tempo2.RightMargin")));
this.tempo2.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("tempo2.RightToLeft")));
this.tempo2.ScrollBars = ((System.Windows.Forms.RichTextBoxScrollBars)(resources.GetObject("tempo2.ScrollBars")));
this.tempo2.Size = ((System.Drawing.Size)(resources.GetObject("tempo2.Size")));
this.tempo2.TabIndex = ((int)(resources.GetObject("tempo2.TabIndex")));
this.tempo2.Text = resources.GetString("tempo2.Text");
this.tempo2.Visible = ((bool)(resources.GetObject("tempo2.Visible")));
this.tempo2.WordWrap = ((bool)(resources.GetObject("tempo2.WordWrap")));
this.tempo2.ZoomFactor = ((System.Single)(resources.GetObject("tempo2.ZoomFactor")));
//
// label3
//
this.label3.AccessibleDescription = resources.GetString("label3.AccessibleDescription");
this.label3.AccessibleName = resources.GetString("label3.AccessibleName");
this.label3.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("label3.Anchor")));
this.label3.AutoSize = ((bool)(resources.GetObject("label3.AutoSize")));
this.label3.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("label3.Dock")));
this.label3.Enabled = ((bool)(resources.GetObject("label3.Enabled")));
this.label3.Font = ((System.Drawing.Font)(resources.GetObject("label3.Font")));
this.label3.ForeColor = System.Drawing.Color.Yellow;
this.label3.Image = ((System.Drawing.Image)(resources.GetObject("label3.Image")));
this.label3.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("label3.ImageAlign")));
this.label3.ImageIndex = ((int)(resources.GetObject("label3.ImageIndex")));
this.label3.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("label3.ImeMode")));
this.label3.Location = ((System.Drawing.Point)(resources.GetObject("label3.Location")));
this.label3.Name = "label3";
this.label3.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("label3.RightToLeft")));
this.label3.Size = ((System.Drawing.Size)(resources.GetObject("label3.Size")));
this.label3.TabIndex = ((int)(resources.GetObject("label3.TabIndex")));
this.label3.Text = resources.GetString("label3.Text");
this.label3.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("label3.TextAlign")));
this.label3.Visible = ((bool)(resources.GetObject("label3.Visible")));
//
// MassM
//
this.AccessibleDescription = resources.GetString("$this.AccessibleDescription");
this.AccessibleName = resources.GetString("$this.AccessibleName");
this.AutoScaleBaseSize = ((System.Drawing.Size)(resources.GetObject("$this.AutoScaleBaseSize")));
this.AutoScroll = ((bool)(resources.GetObject("$this.AutoScroll")));
this.AutoScrollMargin = ((System.Drawing.Size)(resources.GetObject("$this.AutoScrollMargin")));
this.AutoScrollMinSize = ((System.Drawing.Size)(resources.GetObject("$this.AutoScrollMinSize")));
this.BackColor = System.Drawing.Color.Blue;
this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage")));
this.ClientSize = ((System.Drawing.Size)(resources.GetObject("$this.ClientSize")));
this.Controls.Add(this.mess);
this.Controls.Add(this.label3);
this.Controls.Add(this.boh);
this.Controls.Add(this.button1);
this.Controls.Add(this.c2);
this.Controls.Add(this.c1);
this.Controls.Add(this.label1);
this.Controls.Add(this.tempo2);
this.Enabled = ((bool)(resources.GetObject("$this.Enabled")));
this.Font = ((System.Drawing.Font)(resources.GetObject("$this.Font")));
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("$this.ImeMode")));
this.Location = ((System.Drawing.Point)(resources.GetObject("$this.Location")));
this.MaximizeBox = false;
this.MaximumSize = ((System.Drawing.Size)(resources.GetObject("$this.MaximumSize")));
this.MinimumSize = ((System.Drawing.Size)(resources.GetObject("$this.MinimumSize")));
this.Name = "MassM";
this.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("$this.RightToLeft")));
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Show;
this.StartPosition = ((System.Windows.Forms.FormStartPosition)(resources.GetObject("$this.StartPosition")));
this.Text = resources.GetString("$this.Text");
this.
Load += new System.
EventHandler(this.
MassM_Load);
this.ResumeLayout(false);
}
#endregion
/// <summary>
/// The main entry point for the application.
/// </summary>
private void button1_Click(object sender, System.EventArgs e)
{
if(hub=="")
{
MessageBox.Show("InSeRiSCi Una PoRTa","Error",MessageBoxButtons.OK,MessageBoxIcon.Error);
return;
}
if(porta=="")
{
MessageBox.Show("InSeRiSCi UnA PoRTa","Error",MessageBoxButtons.OK,MessageBoxIcon.Error);
return;
}
{
MessageBox.Show("SpuNTa ALMeNo Due DeLLe 2 CaSeLLe)","Error",MessageBoxButtons.OK,MessageBoxIcon.Error);
return;
}
tempo=0;
timer.Start();
boh.Text="";
MassMessage mass
= new MassMessage
(hub,Convert.
ToInt32(porta
),mess,c1,c2,boh,tempo2,timer
);
ThreadStart masstart
= new ThreadStart
(mass.
RunMe);
masst
= new Thread
(masstart
);
masst.Start();
}
void porta_KeyPress(object sender, KeyPressEventArgs e)
{
char ch=e.KeyChar;
if (ch==8)
return;
if (char.IsDigit(ch)==false)
e.Handled=true;
}
private void timer_Tick(object sender, System.EventArgs e)
{
tempo+=1;
tempo2.Text=Convert.ToString((tempo));
}
private void MassM_Load(object sender, System.EventArgs e)
{
}
}
}