using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Text;
using System.Threading;
namespace WindowsApplication36
{
/// <summary>
/// Descrizione di riepilogo per Form1.
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
Thread t;
string directory;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.TextBox delay;
private System.Windows.Forms.RichTextBox r;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Button button3;
private System.Windows.Forms.Button button4;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
/// <summary>
/// Variabile di progettazione necessaria.
/// </summary>
private System.ComponentModel.Container components = null;
public Form1()
{
//
// Necessario per il supporto di Progettazione Windows Form
//
InitializeComponent();
//
// TODO: aggiungere il codice del costruttore dopo la chiamata a InitializeComponent
//
}
/// <summary>
/// Pulire le risorse in uso.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Codice generato da Progettazione Windows Form
/// <summary>
/// Metodo necessario per il supporto della finestra di progettazione. Non modificare
/// il contenuto del metodo con l'editor di codice.
/// </summary>
private void InitializeComponent()
{
System.Resources.
ResourceManager resources
= new System.Resources.
ResourceManager(typeof(Form1
));
this.
button1 = new System.
Windows.
Forms.
Button();
this.
delay = new System.
Windows.
Forms.
TextBox();
this.
r = new System.
Windows.
Forms.
RichTextBox();
this.
button2 = new System.
Windows.
Forms.
Button();
this.
button3 = new System.
Windows.
Forms.
Button();
this.
button4 = new System.
Windows.
Forms.
Button();
this.
label1 = new System.
Windows.
Forms.
Label();
this.
label2 = new System.
Windows.
Forms.
Label();
this.SuspendLayout();
//
// button1
//
this.
button1.
Location = new System.Drawing.
Point(48, 64
);
this.button1.Name = "button1";
this.
button1.
Size = new System.Drawing.
Size(72, 32
);
this.button1.TabIndex = 0;
this.button1.Text = "RaR";
this.
button1.
Click += new System.
EventHandler(this.
button1_Click);
//
// delay
//
this.
delay.
Location = new System.Drawing.
Point(40, 24
);
this.delay.Name = "delay";
this.
delay.
Size = new System.Drawing.
Size(304, 20
);
this.delay.TabIndex = 1;
this.delay.Text = "";
//
// r
//
this.
r.
Location = new System.Drawing.
Point(48, 184
);
this.r.Name = "r";
this.
r.
Size = new System.Drawing.
Size(304, 96
);
this.r.TabIndex = 2;
this.r.Text = "";
//
// button2
//
this.
button2.
Location = new System.Drawing.
Point(48, 128
);
this.button2.Name = "button2";
this.
button2.
Size = new System.Drawing.
Size(72, 32
);
this.button2.TabIndex = 3;
this.button2.Text = "Mp3";
this.
button2.
Click += new System.
EventHandler(this.
button2_Click);
//
// button3
//
this.
button3.
Location = new System.Drawing.
Point(272, 64
);
this.button3.Name = "button3";
this.
button3.
Size = new System.Drawing.
Size(72, 32
);
this.button3.TabIndex = 4;
this.button3.Text = "ExE";
this.
button3.
Click += new System.
EventHandler(this.
button3_Click);
//
// button4
//
this.
button4.
Location = new System.Drawing.
Point(272, 128
);
this.button4.Name = "button4";
this.
button4.
Size = new System.Drawing.
Size(72, 32
);
this.button4.TabIndex = 5;
this.button4.Text = "JPeG";
this.
button4.
Click += new System.
EventHandler(this.
button4_Click);
//
// label1
//
this.
label1.
Location = new System.Drawing.
Point(168, 8
);
this.label1.Name = "label1";
this.
label1.
Size = new System.Drawing.
Size(168, 16
);
this.label1.TabIndex = 6;
this.label1.Text = "DeLaY";
//
// label2
//
this.
label2.
Location = new System.Drawing.
Point(168, 160
);
this.label2.Name = "label2";
this.
label2.
Size = new System.Drawing.
Size(168, 16
);
this.label2.TabIndex = 7;
this.label2.Text = "LoG";
//
// Form1
//
this.
AutoScaleBaseSize = new System.Drawing.
Size(5, 13
);
this.
ClientSize = new System.Drawing.
Size(400, 310
);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.button4);
this.Controls.Add(this.button3);
this.Controls.Add(this.button2);
this.Controls.Add(this.r);
this.Controls.Add(this.delay);
this.Controls.Add(this.button1);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "Form1";
this.Text = "SaTaNa RaGGruPPa FiLe..(VeRSioNe BeTa DeMo)";
this.ResumeLayout(false);
}
#endregion
/// <summary>
/// Il punto di ingresso principale dell'applicazione.
/// </summary>
[STAThread]
static void Main()
{
Application.
Run(new Form1
());
}
private void button1_Click(object sender, System.EventArgs e)
{
Directory.CreateDirectory("C:\\SaTaNa-RaR");
directory = "C:\\";
t
= new Thread
(new ThreadStart
(Cerca1
));
t.Start();
}
public void Cerca(string path)
{
try
{
string[] dirs1 = Directory.GetDirectories(@path);
string[] dirs2 = Directory.GetFiles(@path,"*.rar");
foreach (string dir in dirs2)
{
// dir = path+nomefile trovato
string[] a = dir.Split("\\".ToCharArray());
File.Copy(dir,"C:\\SaTaNa-RaR\\"+a[a.Length-1]);
}
foreach (string dir in dirs1)
{
r.Text="Directory controllata: "+dir+"\n";
Thread.Sleep(Convert.ToInt32(delay.Text));
Cerca(dir);
}
}
catch(Exception e)
{MessageBox.Show(e.ToString());}
}
public void Cerca1()
{
string path = directory;
try
{
string[] dirs1 = Directory.GetDirectories(@path);
string[] dirs2 = Directory.GetFiles(@path,"*.rar");
foreach (string dir in dirs2)
{
// dir = path+nomefile trovato
string[] a = dir.Split("\\".ToCharArray());
File.Copy(dir,"C:\\SaTaNa-RaR\\"+a[a.Length-1]);
}
foreach (string dir in dirs1)
{
r.Text="Directory controllata: "+dir+"\n";
Thread.Sleep(Convert.ToInt32(delay.Text));
Cerca(dir);
}
}
catch(Exception e)
{MessageBox.Show(e.ToString());}
}
private void button2_Click(object sender, System.EventArgs e)
{
Directory.CreateDirectory("C:\\SaTaNa-MP3");
directory = "C:\\";
t
= new Thread
(new ThreadStart
(Cerca4
));
t.Start();
}
public void Cerca3(string path)
{
try
{
string[] dirs1 = Directory.GetDirectories(@path);
string[] dirs2 = Directory.GetFiles(@path.ToLower(),"*.mp3");
foreach (string dir in dirs2)
{
// dir = path+nomefile trovato
string[] a = dir.Split("\\".ToCharArray());
File.Copy(dir,"C:\\SaTaNa-MP3\\"+a[a.Length-1]);
}
foreach (string dir in dirs1)
{
r.Text="Directory controllata: "+dir+"\n";
Thread.Sleep(Convert.ToInt32(delay.Text));
Cerca(dir);
}
}
catch(Exception e)
{MessageBox.Show(e.ToString());}
}
public void Cerca4()
{
string path = directory;
try
{
string[] dirs1 = Directory.GetDirectories(@path);
string[] dirs2 = Directory.GetFiles(@path.ToLower(),"*.mp3");
foreach (string dir in dirs2)
{
// dir = path+nomefile trovato
string[] a = dir.Split("\\".ToCharArray());
File.Copy(dir,"C:\\SaTaNa-MP3\\"+a[a.Length-1]);
}
foreach (string dir in dirs1)
{
r.Text="Directory controllata: "+dir+"\n";
Thread.Sleep(Convert.ToInt32(delay.Text));
Cerca(dir);
}
}
catch(Exception e)
{MessageBox.Show(e.ToString());}
}
private void button3_Click(object sender, System.EventArgs e)
{
Directory.CreateDirectory("C:\\SaTaNa-ExE");
directory = "C:\\";
t
= new Thread
(new ThreadStart
(Cerca6
));
t.Start();
}
public void Cerca5(string path)
{
try
{
string[] dirs1 = Directory.GetDirectories(@path);
string[] dirs2 = Directory.GetFiles(@path.ToLower(),"*.exe");
foreach (string dir in dirs2)
{
// dir = path+nomefile trovato
string[] a = dir.Split("\\".ToCharArray());
File.Copy(dir,"C:\\SaTaNa-ExE\\"+a[a.Length-1]);
}
foreach (string dir in dirs1)
{
r.Text="Directory controllata: "+dir+"\n";
Thread.Sleep(Convert.ToInt32(delay.Text));
Cerca(dir);
}
}
catch(Exception e)
{MessageBox.Show(e.ToString());}
}
public void Cerca6()
{
string path = directory;
try
{
string[] dirs1 = Directory.GetDirectories(@path);
string[] dirs2 = Directory.GetFiles(@path,"*.exe");
foreach (string dir in dirs2)
{
// dir = path+nomefile trovato
string[] a = dir.Split("\\".ToCharArray());
File.Copy(dir,"C:\\SaTaNa-ExE\\"+a[a.Length-1]);
}
foreach (string dir in dirs1)
{
r.Text="Directory controllata: "+dir+"\n";
Thread.Sleep(Convert.ToInt32(delay.Text));
Cerca(dir);
}
}
catch(Exception e)
{MessageBox.Show(e.ToString());}
}
private void button4_Click(object sender, System.EventArgs e)
{
Directory.CreateDirectory("C:\\SaTaNa-JPEG");
directory = "C:\\";
t
= new Thread
(new ThreadStart
(Cerca8
));
t.Start();
}
public void Cerca7(string path)
{
try
{
string[] dirs1 = Directory.GetDirectories(@path);
string[] dirs2 = Directory.GetFiles(@path,"*.jpg");
foreach (string dir in dirs2)
{
// dir = path+nomefile trovato
string[] a = dir.Split("\\".ToCharArray());
File.Copy(dir,"C:\\SaTaNa-JPEG\\"+a[a.Length-1]);
}
foreach (string dir in dirs1)
{
r.Text="Directory controllata: "+dir+"\n";
Thread.Sleep(Convert.ToInt32(delay.Text));
Cerca(dir);
}
}
catch(Exception e)
{MessageBox.Show(e.ToString());}
}
public void Cerca8()
{
string path = directory;
try
{
string[] dirs1 = Directory.GetDirectories(@path);
string[] dirs2 = Directory.GetFiles(@path,"*.jpg");
foreach (string dir in dirs2)
{
// dir = path+nomefile trovato
string[] a = dir.Split("\\".ToCharArray());
File.Copy(dir,"C:\\SaTaNa-JPEG\\"+a[a.Length-1]);
}
foreach (string dir in dirs1)
{
r.Text="Directory controllata: "+dir+"\n";
Thread.Sleep(Convert.ToInt32(delay.Text));
Cerca(dir);
}
}
catch(Exception e)
{MessageBox.Show(e.ToString());}
}
}
}