コード例 #1
0
 void LeftClick(object sender, MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Left)
     {
         //MessageBox.Show(sender.ToString() + "\n" + e.ToString());
         UploadHdr.Auto();
     }
 }
コード例 #2
0
ファイル: Form1.cs プロジェクト: fritz3n/HllmUp-V2
        private void Login()
        {
            LoginButt.Enabled = false;

            bool worked = UploadHdr.Login(Username.Text, Password.Text);

            if (RegistryHdr.getValue("context") != ContextEnable.Checked.ToString() & !(ContextEnable.Checked == false & RegistryHdr.getValue("context") == ""))
            {
                //todo: E/Disable content thingy thing
                MessageBox.Show("An elevated Process needs to be started to enable explorer right-clicking.\nPlease click yes.");

                var exeName = System.Reflection.Assembly.GetExecutingAssembly().CodeBase.Substring(8).Replace('/', '\\');
                ProcessStartInfo startInfo = new ProcessStartInfo(exeName);
                startInfo.Verb = "runas";

                if (ContextEnable.Checked == true)
                {
                    startInfo.Arguments = "RegisterRC";
                }
                else
                {
                    startInfo.Arguments = "DeRegisterRC";
                }

                Process p = Process.Start(startInfo);
                p.WaitForExit();

                RegistryHdr.setValue("context", ContextEnable.Checked.ToString());
                UploadHdr.Context = ContextEnable.Checked;
            }

            if (RegistryHdr.getValue("autostart") != AutostartEnable.Checked.ToString())
            {
                StartupHdr.Autostart(AutostartEnable.Checked);
            }

            UpdateAll();

            if (worked == true)
            {
                Username.Text = "";
                Password.Text = "";

                ErrorText.Text = "";

                System.Media.SystemSounds.Hand.Play();
            }
            else
            {
                ErrorText.Text = "Couldn't log in!";
                Password.Text  = "";

                System.Media.SystemSounds.Asterisk.Play();
            }

            LoginButt.Enabled = true;
        }
コード例 #3
0
        public IconHdr()
        {
            string[] arguments = Environment.GetCommandLineArgs();

            //MessageBox.Show(arguments.Concat);

            if (arguments.Length > 1)
            {
                if (arguments[1] == "RegisterRC")
                {
                    StartupHdr.RegisterRC();
                    notifyIcon.Visible = false;
                    //Application.Exit();
                    //MessageBox.Show("closing");
                    Environment.Exit(0);
                }
                else if (arguments[1] == "DeRegisterRC")
                {
                    StartupHdr.DeRegisterRC();
                    notifyIcon.Visible = false;
                    //Application.Exit();
                    //MessageBox.Show("closing");
                    Environment.Exit(0);
                }
                else
                {
                    StartupHdr.Startup(configWindow);

                    for (int i = 1; i < arguments.Count(); i++)
                    {
                        string path = arguments[i];
                        UploadHdr.Upload(path);
                    }
                    System.Media.SystemSounds.Hand.Play();
                    Environment.Exit(0);
                }
            }
            else
            {
                HotKeyHdr Hotkeys = new HotKeyHdr();


                MenuItem consoleMenuItem = new MenuItem("Console", new EventHandler(ShowConsole));
                MenuItem configMenuItem  = new MenuItem("Configuration", new EventHandler(ShowConfig));
                MenuItem exitMenuItem    = new MenuItem("Exit", new EventHandler(Exit));


                notifyIcon.Icon        = Icon.ExtractAssociatedIcon(Assembly.GetExecutingAssembly().Location);;
                notifyIcon.ContextMenu = new ContextMenu(new MenuItem[]
                                                         { consoleMenuItem, configMenuItem, exitMenuItem });
                notifyIcon.MouseClick += new MouseEventHandler(LeftClick);
                notifyIcon.Visible     = true;

                StartupHdr.Startup(configWindow);
            }
        }
コード例 #4
0
ファイル: StartupHdr.cs プロジェクト: fritz3n/HllmUp-V2
        static public void Startup(Form1 form)
        {
            Form = form;

            if (UploadHdr.Recover() != true)
            {
                form.ShowDialog();
                System.Media.SystemSounds.Asterisk.Play();
            }
        }
コード例 #5
0
ファイル: HotKeyHdr.cs プロジェクト: fritz3n/HllmUp-V2
        public void Screenshot_KeyPressed(object sender, KeyPressedEventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;
            string ImgPath = Path.GetTempPath() + "screenshot_" + DateTime.Now.ToString("dd-MM-yy_HH.mm.ss") + ".png";
            Bitmap image   = screenshot();

            image.Save(ImgPath, System.Drawing.Imaging.ImageFormat.Png);
            UploadHdr.Upload(ImgPath, "screenshots/", true);
            File.Delete(ImgPath);
            System.Media.SystemSounds.Hand.Play();
        }
コード例 #6
0
ファイル: HotKeyHdr.cs プロジェクト: fritz3n/HllmUp-V2
        public void ScreenClip_KeyPressed(object sender, KeyPressedEventArgs e)
        {
            Process proc = Process.Start("snippingtool", "/clip");

            proc.WaitForExit();

            if (Clipboard.ContainsImage())
            {
                string path = Path.GetTempPath() + "screenshot_" + DateTime.Now.ToString("dd-MM-yy_HH.mm.ss") + ".png";
                Image  img  = Clipboard.GetImage();
                img.Save(path, System.Drawing.Imaging.ImageFormat.Png);
                UploadHdr.Upload(path, "screenshots/", true);
                File.Delete(path);
                System.Media.SystemSounds.Hand.Play();
            }
            else
            {
                MessageBox.Show("ERROR!");
            }
        }
コード例 #7
0
ファイル: Form1.cs プロジェクト: fritz3n/HllmUp-V2
 private void LogoutButt_Click(object sender, EventArgs e)
 {
     UploadHdr.Logout();
     UpdateAll();
 }
コード例 #8
0
ファイル: HotKeyHdr.cs プロジェクト: fritz3n/HllmUp-V2
 public void Upload_KeyPressed(object sender, KeyPressedEventArgs e)
 {
     UploadHdr.Auto();
 }
コード例 #9
0
        static private bool commandLineStep()
        {
            Console.Write(">");
            string raw = Console.ReadLine();
            int    x   = 2;

            string[] rawArray = raw.Split(new char[] { ' ' }, x);
            string   command  = rawArray[0];

            List <string> args = new List <string>();

            if (rawArray.Length > 1)
            {
                string pattern = "[\"'](.*?)[\"']|([^ \"'\\s]+)";

                Regex rgx          = new Regex(pattern);
                int[] groupNumbers = rgx.GetGroupNumbers();

                Match m = rgx.Match(rawArray[1]);

                while (m.Success)
                {
                    for (int i = 1; i <= 2; i++)
                    {
                        Group             g  = m.Groups[i];
                        CaptureCollection cc = g.Captures;
                        if (cc.Count > 0)
                        {
                            args.Add(cc[0].Value);
                        }
                    }
                    m = m.NextMatch();
                }
            }

            switch (command)
            {
            case "damn":
            case "bye":
            case "kys":
            case "quit":
            case "close":
            case "exit":
                write("Bye!");
                System.Threading.Thread.Sleep(500);
                return(false);

                //FreeCons();
                break;

            case "upload":
                if (args.Count == 0)
                {
                    OpenFileDialog opf    = new OpenFileDialog();
                    DialogResult   result = opf.ShowDialog();

                    if (result == DialogResult.OK)
                    {
                        UploadHdr.Upload(opf.FileName);
                    }
                    else
                    {
                        writeE("There was an problem with:\n" + opf.FileName);
                    }
                }
                else
                {
                    foreach (string path in args)
                    {
                        UploadHdr.Upload(path);
                    }
                }
                break;

            case "logout":
                UploadHdr.Logout();
                Console.WriteLine("Please log back in");
                StartupHdr.ShowLogin();
                break;

            case "screenshot":

                Process proc = Process.Start("snippingtool", "/clip");

                proc.WaitForExit();

                if (Clipboard.ContainsImage())
                {
                    string path = Path.GetTempPath() + "screenshot_" + DateTime.Now.ToString("dd-MM-yy_HH.mm.ss") + ".png";
                    Image  img  = Clipboard.GetImage();
                    img.Save(path, System.Drawing.Imaging.ImageFormat.Png);
                    UploadHdr.Upload(path, "screenshots/", true);
                    File.Delete(path);
                }
                else
                {
                    writeE("Theres no picture!");
                }
                break;

            case "fullscreenshot":

                string ImgPath = Path.GetTempPath() + "screenshot_" + DateTime.Now.ToString("dd-MM-yy_HH.mm.ss") + ".png";
                Bitmap image   = HotKeyHdr.screenshot();
                image.Save(ImgPath, System.Drawing.Imaging.ImageFormat.Png);
                UploadHdr.Upload(ImgPath, "screenshots/", true);
                File.Delete(ImgPath);

                break;


            default:
                writeE("Unrecognized command: " + command);
                break;
            }

            return(true);
        }