Questo sito utilizza cookies solo per scopi di autenticazione sul sito e nient'altro. Nessuna informazione personale viene tracciata. Leggi l'informativa sui cookies.
Username: Password: oppure
Magiordomo By SaTaNa (Beta) - Form1.cs

Form1.cs

Caricato da:
Scarica il programma completo

  1. using System;
  2. using System.Drawing;
  3. using System.Collections;
  4. using System.ComponentModel;
  5. using System.Windows.Forms;
  6. using System.Data;
  7. using System.IO;
  8. using System.Text;
  9. using System.Threading;
  10.  
  11. namespace WindowsApplication36
  12. {
  13.         /// <summary>
  14.         /// Descrizione di riepilogo per Form1.
  15.         /// </summary>
  16.         public class Form1 : System.Windows.Forms.Form
  17.         {
  18.                 Thread t;
  19.                 string directory;
  20.                 private System.Windows.Forms.Button button1;
  21.                 private System.Windows.Forms.TextBox delay;
  22.                 private System.Windows.Forms.RichTextBox r;
  23.                 private System.Windows.Forms.Button button2;
  24.                 private System.Windows.Forms.Button button3;
  25.                 private System.Windows.Forms.Button button4;
  26.                 private System.Windows.Forms.Label label1;
  27.                 private System.Windows.Forms.Label label2;
  28.                 /// <summary>
  29.                 /// Variabile di progettazione necessaria.
  30.                 /// </summary>
  31.                 private System.ComponentModel.Container components = null;
  32.  
  33.                 public Form1()
  34.                 {
  35.                         //
  36.                         // Necessario per il supporto di Progettazione Windows Form
  37.                         //
  38.                         InitializeComponent();
  39.  
  40.                         //
  41.                         // TODO: aggiungere il codice del costruttore dopo la chiamata a InitializeComponent
  42.                         //
  43.                 }
  44.  
  45.                 /// <summary>
  46.                 /// Pulire le risorse in uso.
  47.                 /// </summary>
  48.                 protected override void Dispose( bool disposing )
  49.                 {
  50.                         if( disposing )
  51.                         {
  52.                                 if (components != null)
  53.                                 {
  54.                                         components.Dispose();
  55.                                 }
  56.                         }
  57.                         base.Dispose( disposing );
  58.                 }
  59.  
  60.                 #region Codice generato da Progettazione Windows Form
  61.                 /// <summary>
  62.                 /// Metodo necessario per il supporto della finestra di progettazione. Non modificare
  63.                 /// il contenuto del metodo con l'editor di codice.
  64.                 /// </summary>
  65.                 private void InitializeComponent()
  66.                 {
  67.                         System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form1));
  68.                         this.button1 = new System.Windows.Forms.Button();
  69.                         this.delay = new System.Windows.Forms.TextBox();
  70.                         this.r = new System.Windows.Forms.RichTextBox();
  71.                         this.button2 = new System.Windows.Forms.Button();
  72.                         this.button3 = new System.Windows.Forms.Button();
  73.                         this.button4 = new System.Windows.Forms.Button();
  74.                         this.label1 = new System.Windows.Forms.Label();
  75.                         this.label2 = new System.Windows.Forms.Label();
  76.                         this.SuspendLayout();
  77.                         //
  78.                         // button1
  79.                         //
  80.                         this.button1.Location = new System.Drawing.Point(48, 64);
  81.                         this.button1.Name = "button1";
  82.                         this.button1.Size = new System.Drawing.Size(72, 32);
  83.                         this.button1.TabIndex = 0;
  84.                         this.button1.Text = "RaR";
  85.                         this.button1.Click += new System.EventHandler(this.button1_Click);
  86.                         //
  87.                         // delay
  88.                         //
  89.                         this.delay.Location = new System.Drawing.Point(40, 24);
  90.                         this.delay.Name = "delay";
  91.                         this.delay.Size = new System.Drawing.Size(304, 20);
  92.                         this.delay.TabIndex = 1;
  93.                         this.delay.Text = "";
  94.                         //
  95.                         // r
  96.                         //
  97.                         this.r.Location = new System.Drawing.Point(48, 184);
  98.                         this.r.Name = "r";
  99.                         this.r.Size = new System.Drawing.Size(304, 96);
  100.                         this.r.TabIndex = 2;
  101.                         this.r.Text = "";
  102.                         //
  103.                         // button2
  104.                         //
  105.                         this.button2.Location = new System.Drawing.Point(48, 128);
  106.                         this.button2.Name = "button2";
  107.                         this.button2.Size = new System.Drawing.Size(72, 32);
  108.                         this.button2.TabIndex = 3;
  109.                         this.button2.Text = "Mp3";
  110.                         this.button2.Click += new System.EventHandler(this.button2_Click);
  111.                         //
  112.                         // button3
  113.                         //
  114.                         this.button3.Location = new System.Drawing.Point(272, 64);
  115.                         this.button3.Name = "button3";
  116.                         this.button3.Size = new System.Drawing.Size(72, 32);
  117.                         this.button3.TabIndex = 4;
  118.                         this.button3.Text = "ExE";
  119.                         this.button3.Click += new System.EventHandler(this.button3_Click);
  120.                         //
  121.                         // button4
  122.                         //
  123.                         this.button4.Location = new System.Drawing.Point(272, 128);
  124.                         this.button4.Name = "button4";
  125.                         this.button4.Size = new System.Drawing.Size(72, 32);
  126.                         this.button4.TabIndex = 5;
  127.                         this.button4.Text = "JPeG";
  128.                         this.button4.Click += new System.EventHandler(this.button4_Click);
  129.                         //
  130.                         // label1
  131.                         //
  132.                         this.label1.Location = new System.Drawing.Point(168, 8);
  133.                         this.label1.Name = "label1";
  134.                         this.label1.Size = new System.Drawing.Size(168, 16);
  135.                         this.label1.TabIndex = 6;
  136.                         this.label1.Text = "DeLaY";
  137.                         //
  138.                         // label2
  139.                         //
  140.                         this.label2.Location = new System.Drawing.Point(168, 160);
  141.                         this.label2.Name = "label2";
  142.                         this.label2.Size = new System.Drawing.Size(168, 16);
  143.                         this.label2.TabIndex = 7;
  144.                         this.label2.Text = "LoG";
  145.                         //
  146.                         // Form1
  147.                         //
  148.                         this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
  149.                         this.ClientSize = new System.Drawing.Size(400, 310);
  150.                         this.Controls.Add(this.label2);
  151.                         this.Controls.Add(this.label1);
  152.                         this.Controls.Add(this.button4);
  153.                         this.Controls.Add(this.button3);
  154.                         this.Controls.Add(this.button2);
  155.                         this.Controls.Add(this.r);
  156.                         this.Controls.Add(this.delay);
  157.                         this.Controls.Add(this.button1);
  158.                         this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
  159.                         this.Name = "Form1";
  160.                         this.Text = "SaTaNa RaGGruPPa FiLe..(VeRSioNe BeTa DeMo)";
  161.                         this.ResumeLayout(false);
  162.  
  163.                 }
  164.                 #endregion
  165.  
  166.                 /// <summary>
  167.                 /// Il punto di ingresso principale dell'applicazione.
  168.                 /// </summary>
  169.                 [STAThread]
  170.                 static void Main()
  171.                 {
  172.                         Application.Run(new Form1());
  173.                 }
  174.  
  175.                 private void button1_Click(object sender, System.EventArgs e)
  176.                 {
  177.                         Directory.CreateDirectory("C:\\SaTaNa-RaR");
  178.                         directory =  "C:\\";
  179.                         t = new Thread(new ThreadStart(Cerca1));
  180.                         t.Start();
  181.  
  182.                 }
  183.                 public void Cerca(string path)
  184.                 {
  185.                
  186.                         try
  187.                         {
  188.                                 string[] dirs1 = Directory.GetDirectories(@path);
  189.                                 string[] dirs2 = Directory.GetFiles(@path,"*.rar");
  190.                                 foreach (string dir in dirs2)
  191.                                 {
  192.                                                
  193.                                         // dir = path+nomefile trovato
  194.                                         string[] a = dir.Split("\\".ToCharArray());
  195.                                         File.Copy(dir,"C:\\SaTaNa-RaR\\"+a[a.Length-1]);
  196.                                 }
  197.                                 foreach (string dir in dirs1)
  198.                                 {
  199.                                         r.Text="Directory controllata: "+dir+"\n";
  200.                                         Thread.Sleep(Convert.ToInt32(delay.Text));
  201.                                         Cerca(dir);
  202.                                 }
  203.                         }
  204.                         catch(Exception e)
  205.                         {MessageBox.Show(e.ToString());}
  206.                 }
  207.        
  208.                 public void Cerca1()
  209.                
  210.                 {
  211.                         string path = directory;  
  212.                         try
  213.                         {
  214.                                 string[] dirs1 = Directory.GetDirectories(@path);
  215.                                 string[] dirs2 = Directory.GetFiles(@path,"*.rar");
  216.                                 foreach (string dir in dirs2)
  217.                                 {
  218.                                         // dir = path+nomefile trovato
  219.                                         string[] a = dir.Split("\\".ToCharArray());
  220.                                         File.Copy(dir,"C:\\SaTaNa-RaR\\"+a[a.Length-1]);
  221.                                 }
  222.                                 foreach (string dir in dirs1)
  223.                                 {
  224.                                         r.Text="Directory controllata: "+dir+"\n";
  225.                                         Thread.Sleep(Convert.ToInt32(delay.Text));
  226.                                         Cerca(dir);
  227.                                 }
  228.                         }
  229.                         catch(Exception e)
  230.                         {MessageBox.Show(e.ToString());}
  231.                 }
  232.  
  233.                 private void button2_Click(object sender, System.EventArgs e)
  234.                 {
  235.                         Directory.CreateDirectory("C:\\SaTaNa-MP3");
  236.                         directory =  "C:\\";
  237.                         t = new Thread(new ThreadStart(Cerca4));
  238.                         t.Start();
  239.  
  240.                 }
  241.                 public void Cerca3(string path)
  242.                 {
  243.                
  244.                         try
  245.                         {
  246.                                 string[] dirs1 = Directory.GetDirectories(@path);
  247.                                 string[] dirs2 = Directory.GetFiles(@path.ToLower(),"*.mp3");
  248.                                 foreach (string dir in dirs2)
  249.                                 {
  250.                                                
  251.                                         // dir = path+nomefile trovato
  252.                                         string[] a = dir.Split("\\".ToCharArray());
  253.                                         File.Copy(dir,"C:\\SaTaNa-MP3\\"+a[a.Length-1]);
  254.                                 }
  255.                                 foreach (string dir in dirs1)
  256.                                 {
  257.                                         r.Text="Directory controllata: "+dir+"\n";
  258.                                         Thread.Sleep(Convert.ToInt32(delay.Text));
  259.                                         Cerca(dir);
  260.                                 }
  261.                         }
  262.                         catch(Exception e)
  263.                         {MessageBox.Show(e.ToString());}
  264.                 }
  265.        
  266.                 public void Cerca4()
  267.                
  268.                 {
  269.                         string path = directory;  
  270.                         try
  271.                         {
  272.                                 string[] dirs1 = Directory.GetDirectories(@path);
  273.                                 string[] dirs2 = Directory.GetFiles(@path.ToLower(),"*.mp3");
  274.                                 foreach (string dir in dirs2)
  275.                                 {
  276.                                         // dir = path+nomefile trovato
  277.                                         string[] a = dir.Split("\\".ToCharArray());
  278.                                         File.Copy(dir,"C:\\SaTaNa-MP3\\"+a[a.Length-1]);
  279.                                 }
  280.                                 foreach (string dir in dirs1)
  281.                                 {
  282.                                         r.Text="Directory controllata: "+dir+"\n";
  283.                                         Thread.Sleep(Convert.ToInt32(delay.Text));
  284.                                         Cerca(dir);
  285.                                 }
  286.                         }
  287.                         catch(Exception e)
  288.                         {MessageBox.Show(e.ToString());}
  289.                 }
  290.  
  291.                 private void button3_Click(object sender, System.EventArgs e)
  292.                 {
  293.                         Directory.CreateDirectory("C:\\SaTaNa-ExE");
  294.                         directory =  "C:\\";
  295.                         t = new Thread(new ThreadStart(Cerca6));
  296.                         t.Start();
  297.  
  298.                 }
  299.                 public void Cerca5(string path)
  300.                 {
  301.                
  302.                         try
  303.                         {
  304.                                 string[] dirs1 = Directory.GetDirectories(@path);
  305.                                 string[] dirs2 = Directory.GetFiles(@path.ToLower(),"*.exe");
  306.                                 foreach (string dir in dirs2)
  307.                                 {
  308.                                                
  309.                                         // dir = path+nomefile trovato
  310.                                         string[] a = dir.Split("\\".ToCharArray());
  311.                                         File.Copy(dir,"C:\\SaTaNa-ExE\\"+a[a.Length-1]);
  312.                                 }
  313.                                 foreach (string dir in dirs1)
  314.                                 {
  315.                                         r.Text="Directory controllata: "+dir+"\n";
  316.                                         Thread.Sleep(Convert.ToInt32(delay.Text));
  317.                                         Cerca(dir);
  318.                                 }
  319.                         }
  320.                         catch(Exception e)
  321.                         {MessageBox.Show(e.ToString());}
  322.                 }
  323.        
  324.                 public void Cerca6()
  325.                
  326.                 {
  327.                         string path = directory;  
  328.                         try
  329.                         {
  330.                                 string[] dirs1 = Directory.GetDirectories(@path);
  331.                                 string[] dirs2 = Directory.GetFiles(@path,"*.exe");
  332.                                 foreach (string dir in dirs2)
  333.                                 {
  334.                                         // dir = path+nomefile trovato
  335.                                         string[] a = dir.Split("\\".ToCharArray());
  336.                                         File.Copy(dir,"C:\\SaTaNa-ExE\\"+a[a.Length-1]);
  337.                                 }
  338.                                 foreach (string dir in dirs1)
  339.                                 {
  340.                                         r.Text="Directory controllata: "+dir+"\n";
  341.                                         Thread.Sleep(Convert.ToInt32(delay.Text));
  342.                                         Cerca(dir);
  343.                                 }
  344.                         }
  345.                         catch(Exception e)
  346.                         {MessageBox.Show(e.ToString());}
  347.                 }
  348.  
  349.                 private void button4_Click(object sender, System.EventArgs e)
  350.                 {
  351.                         Directory.CreateDirectory("C:\\SaTaNa-JPEG");
  352.                         directory =  "C:\\";
  353.                         t = new Thread(new ThreadStart(Cerca8));
  354.                         t.Start();
  355.  
  356.                 }
  357.                 public void Cerca7(string path)
  358.                 {
  359.                
  360.                         try
  361.                         {
  362.                                 string[] dirs1 = Directory.GetDirectories(@path);
  363.                                 string[] dirs2 = Directory.GetFiles(@path,"*.jpg");
  364.                                 foreach (string dir in dirs2)
  365.                                 {
  366.                                                
  367.                                         // dir = path+nomefile trovato
  368.                                         string[] a = dir.Split("\\".ToCharArray());
  369.                                         File.Copy(dir,"C:\\SaTaNa-JPEG\\"+a[a.Length-1]);
  370.                                 }
  371.                                 foreach (string dir in dirs1)
  372.                                 {
  373.                                         r.Text="Directory controllata: "+dir+"\n";
  374.                                         Thread.Sleep(Convert.ToInt32(delay.Text));
  375.                                         Cerca(dir);
  376.                                 }
  377.                         }
  378.                         catch(Exception e)
  379.                         {MessageBox.Show(e.ToString());}
  380.                 }
  381.        
  382.                 public void Cerca8()
  383.                
  384.                 {
  385.                         string path = directory;  
  386.                         try
  387.                         {
  388.                                 string[] dirs1 = Directory.GetDirectories(@path);
  389.                                 string[] dirs2 = Directory.GetFiles(@path,"*.jpg");
  390.                                 foreach (string dir in dirs2)
  391.                                 {
  392.                                         // dir = path+nomefile trovato
  393.                                         string[] a = dir.Split("\\".ToCharArray());
  394.                                         File.Copy(dir,"C:\\SaTaNa-JPEG\\"+a[a.Length-1]);
  395.                                 }
  396.                                 foreach (string dir in dirs1)
  397.                                 {
  398.                                         r.Text="Directory controllata: "+dir+"\n";
  399.                                         Thread.Sleep(Convert.ToInt32(delay.Text));
  400.                                         Cerca(dir);
  401.                                 }
  402.                         }
  403.                         catch(Exception e)
  404.                         {MessageBox.Show(e.ToString());}
  405.                 }
  406.                 }
  407.  
  408.         }