コード例 #1
0
 private void bunifuFlatButton1_Click(object sender, EventArgs e)
 {
     if (Usefull.IsDirectoryEmpty(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), @"Tools\Custom\")))
     {
         Environment.Exit(0);
     }
     else
     {
         foreach (var subDir in new DirectoryInfo(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), @"Tools\Custom\")).GetDirectories())
         {
             subDir.Delete(true);
         }
         Environment.Exit(0);
     }
 }
コード例 #2
0
        private void bunifuFlatButton27_Click(object sender, EventArgs e)
        {
            MessageBox.Show("You have to choose an empty folder that is existing on the Drive where you have this Injector running. \n (As example, if you have this running on C:\\Users\\<your username>\\Desktop you can choose any folder on C: but not on D:)");
selectbrowser:
            FolderBrowserDialog browser = new FolderBrowserDialog();

            string tempPath = "", filesmeta = "", filescontent = "", filescode = "";

            if (folderBrowserDialog1.ShowDialog(this) == DialogResult.OK)
            {
                tempPath = folderBrowserDialog1.SelectedPath;
                if (Usefull.IsDirectoryEmpty(tempPath))
                {
                    if (baserom == 1)
                    {
                        filesmeta    = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), @"Tools\Download\" + folder + @"\meta");
                        filescontent = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), @"Tools\Download\" + folder + @"\content");
                        filescode    = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), @"Tools\Download\" + folder + @"\code");
                    }
                    else if (baserom == 2)
                    {
                        filesmeta    = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), @"Tools\Download\" + folder + @"\meta");
                        filescontent = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), @"Tools\Download\" + folder + @"\content");
                        filescode    = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), @"Tools\Download\" + folder + @"\code");
                    }
                    else if (baserom == 3)
                    {
                        filesmeta    = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), @"Tools\Download\" + folder + @"\meta");
                        filescontent = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), @"Tools\Download\" + folder + @"\content");
                        filescode    = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), @"Tools\Download\" + folder + @"\code");
                    }
                    else if (baserom == 4)
                    {
                        filesmeta    = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), @"Tools\Download\" + folder + @"\meta");
                        filescontent = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), @"Tools\Download\" + folder + @"\content");
                        filescode    = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), @"Tools\Download\" + folder + @"\code");
                    }
                    else if (baserom == 5)
                    {
                        filesmeta    = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), @"Tools\Download\" + folder + @"\meta");
                        filescontent = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), @"Tools\Download\" + folder + @"\content");
                        filescode    = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), @"Tools\Download\" + folder + @"\code");
                    }
                    else if (baserom == 6)
                    {
                        filesmeta    = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), @"Tools\Download\" + folder + @"\meta");
                        filescontent = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), @"Tools\Download\" + folder + @"\content");
                        filescode    = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), @"Tools\Download\" + folder + @"\code");
                    }
                    else if (baserom == 7)
                    {
                        filesmeta    = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), @"Tools\Custom\meta");
                        filescontent = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), @"Tools\Custom\content");
                        filescode    = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), @"Tools\Custom\code");
                    }


                    var Newmeta = Path.Combine(tempPath, @"meta");
                    var Newcon  = Path.Combine(tempPath, @"content");
                    var Newcode = Path.Combine(tempPath, @"code");
                    Directory.Move(filesmeta, Newmeta);
                    Directory.Move(filescontent, Newcon);
                    Directory.Move(filescode, Newcode);
                }
                else
                {
                    MessageBox.Show("Select an empty folder!");
                    goto selectbrowser;
                }
            }
            else
            {
                MessageBox.Show("Select a folder!");
                goto selectbrowser;
            }
            bunifuCustomLabel21.Visible = true;
            bunifuFlatButton27.Enabled  = false;
            bunifuFlatButton27.Visible  = false;
            bunifuFlatButton28.Enabled  = false;
            bunifuFlatButton28.Visible  = false;
            bunifuFlatButton2.Enabled   = false;

            bunifuFlatButton3.Enabled = false;

            bunifuFlatButton4.Enabled = false;
        }