Advertisement
Seregamil

AC for sa:mp

Aug 23rd, 2013
770
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.58 KB | None | 0 0
  1. using System;
  2. using System.IO;
  3. using Microsoft.Win32;
  4. using Microsoft.VisualBasic;
  5.  
  6. namespace ConsoleApplication
  7. {
  8.     class Program
  9.     {
  10.         static void Main(string[] args)
  11.         {
  12.             for( ; ; )
  13.             {
  14.                 using (var key = Registry.ClassesRoot.OpenSubKey(@"samp\shell\open\command\"))
  15.                 {
  16.                     string value = (string)key.GetValue(null);
  17.  
  18.                     value = value.Remove(0,1);
  19.                     value = value.Remove(value.Length-14);
  20.                     key.Close();
  21.  
  22.                     string[] detect_files = { "CLEO.asi", "mod_sa.ini", "d3d9.dll" };
  23.                     string[] detect_dir = { "CLEO" };
  24.  
  25.                     for (int i = 0; i != detect_files.Length; i++)
  26.                     {
  27.                         if (File.Exists(value+detect_files[i]))
  28.                         {
  29.                             File.Delete(value + detect_files[i]);
  30.                             Console.WriteLine("File " + detect_files[i] + " in " + value + detect_files[i] + " deleted");
  31.                         }
  32.                     }
  33.  
  34.                     for (int i = 0; i != detect_dir.Length; i++)
  35.                     {
  36.                         if (Directory.Exists(value + detect_dir[i]))
  37.                         {
  38.                             Directory.Delete(value + detect_dir[i], true);
  39.                             Console.WriteLine("Folder " + detect_dir[i] + " in " + value + detect_dir[i] + " is deleted");
  40.                         }
  41.                     }
  42.                 }
  43.             }
  44.         }
  45.     }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement