Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void start()
- {
- RegistryKey steamreg = Registry.CurrentUser.OpenSubKey(@"Software\Valve\Steam");
- string steamdir = steamreg.GetValue("SteamPath").ToString();
- string steampath = steamdir + "/steamapps/downloading";
- DirectoryInfo dir = new DirectoryInfo(steampath);
- FileInfo[] files = dir.GetFiles();
- startcheck = true;
- while (startcheck)
- {
- if (files.Length > 0)
- {
- label5.Visible = false;
- label3.Visible = true;
- }
- else
- {
- label5.Visible = false;
- label4.Visible = true;
- DialogResult dialogResult = MessageBox.Show("Warning, shutdown imminent. Continue?", "", MessageBoxButtons.YesNo);
- if (dialogResult == DialogResult.No)
- {
- startcheck = false;
- }
- else if (dialogResult == DialogResult.Yes)
- {
- ProcessStartInfo shutdown = new ProcessStartInfo("shutdown");
- shutdown.WindowStyle = ProcessWindowStyle.Hidden;
- shutdown.Arguments = " -s";
- Process startcmd = new Process();
- startcmd.StartInfo = shutdown;
- startcmd.Start();
- }
- }
- Thread.Sleep(60000);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement